Commit 7c9d1d2e authored by SherryChaos's avatar SherryChaos

bug fix

parent 52da2f90
...@@ -1338,7 +1338,7 @@ namespace MDPro3 ...@@ -1338,7 +1338,7 @@ namespace MDPro3
{ {
AudioManager.PlaySE(se); AudioManager.PlaySE(se);
bool cutin = CutinViewer.HasCutin(data.Id); bool cutin = CutinViewer.CutinExist(data.Id);
sequence.Pause(); sequence.Pause();
if (cutin) if (cutin)
{ {
...@@ -1361,7 +1361,7 @@ namespace MDPro3 ...@@ -1361,7 +1361,7 @@ namespace MDPro3
{ {
AudioManager.PlaySE(se); AudioManager.PlaySE(se);
sequence.Pause(); sequence.Pause();
bool cutin = CutinViewer.HasCutin(data.Id); bool cutin = CutinViewer.CutinExist(data.Id);
if (cutin) if (cutin)
await CutinViewer.Play(data.Id, (int)p.controller); await CutinViewer.Play(data.Id, (int)p.controller);
if (data.IsHighLevel()) if (data.IsHighLevel())
......
...@@ -870,7 +870,7 @@ namespace MDPro3.Duel ...@@ -870,7 +870,7 @@ namespace MDPro3.Duel
AudioManager.PlaySE(se); AudioManager.PlaySE(se);
int shakeLevel = 0; int shakeLevel = 0;
if (CutinViewer.HasCutin(card.GetData().Id)) if (CutinViewer.CutinExist(card.GetData().Id))
shakeLevel = 1; shakeLevel = 1;
if (card.GetData().Level > 4) if (card.GetData().Level > 4)
shakeLevel = 1; shakeLevel = 1;
...@@ -998,7 +998,7 @@ namespace MDPro3.Duel ...@@ -998,7 +998,7 @@ namespace MDPro3.Duel
Core.GetUI<OcgCoreUI>().CardDescription.Show(card, card.GetMaterial()); Core.GetUI<OcgCoreUI>().CardDescription.Show(card, card.GetMaterial());
int shakeLevel = 0; int shakeLevel = 0;
if(CutinViewer.HasCutin(card.GetData().Id)) if(CutinViewer.CutinExist(card.GetData().Id))
shakeLevel = 1; shakeLevel = 1;
if (card.GetData().IsHighLevel()) if (card.GetData().IsHighLevel())
shakeLevel = 2; shakeLevel = 2;
......
...@@ -195,7 +195,11 @@ namespace MDPro3 ...@@ -195,7 +195,11 @@ namespace MDPro3
#if !UNITY_EDITOR && (UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN) #if !UNITY_EDITOR && (UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN)
dir = new DirectoryInfo(Path.Combine(Application.dataPath, Program.root + path)); dir = new DirectoryInfo(Path.Combine(Application.dataPath, Program.root + path));
#endif #endif
if (!dir.Exists)
{
Debug.LogError($"[LoadFromFolderAsync]: Path [{dir.FullName}] does not exist.");
return null;
}
FileInfo[] files = dir.GetFiles("*"); FileInfo[] files = dir.GetFiles("*");
List<AssetBundle> bundles = new(); List<AssetBundle> bundles = new();
for (int i = 0; i < files.Length; i++) for (int i = 0; i < files.Length; i++)
......
...@@ -426,7 +426,7 @@ namespace MDPro3 ...@@ -426,7 +426,7 @@ namespace MDPro3
private static async UniTask CacheCutin(int code) private static async UniTask CacheCutin(int code)
{ {
if (!CutinViewer.HasCutin(code)) if (!CutinViewer.CutinExist(code))
return; return;
if (CutinViewer.codes.Contains(code)) if (CutinViewer.codes.Contains(code))
...@@ -604,7 +604,7 @@ namespace MDPro3 ...@@ -604,7 +604,7 @@ namespace MDPro3
OcgCore.summonCard.UpdateExDeckTop(); OcgCore.summonCard.UpdateExDeckTop();
var interval = 0.5f; var interval = 0.5f;
if (CutinViewer.HasCutin(code)) if (CutinViewer.CutinExist(code))
interval = 1f; interval = 1f;
await OcgCore.summonCard.StartCardSequence(position, angle, interval).WaitAsync(); await OcgCore.summonCard.StartCardSequence(position, angle, interval).WaitAsync();
dummyCard = null; dummyCard = null;
......
...@@ -7,6 +7,7 @@ using Spine.Unity; ...@@ -7,6 +7,7 @@ using Spine.Unity;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Threading; using System.Threading;
using TMPro; using TMPro;
using UnityEngine; using UnityEngine;
...@@ -142,7 +143,9 @@ namespace MDPro3.Servant ...@@ -142,7 +143,9 @@ namespace MDPro3.Servant
{ {
if(int.TryParse(dirInfos[i].Name, out var code)) if(int.TryParse(dirInfos[i].Name, out var code))
{ {
Card card = CardsManager.Get(code); Card card = CardsManager.GetCard(code);
if (card == null)
continue;
cards.Add(card); cards.Add(card);
codes.Add(card.Id); codes.Add(card.Id);
} }
...@@ -171,7 +174,7 @@ namespace MDPro3.Servant ...@@ -171,7 +174,7 @@ namespace MDPro3.Servant
Select(); Select();
} }
public static bool HasCutin(int code) public static bool CutinExist(int code)
{ {
if (OcgCore.condition == OcgCore.Condition.Duel if (OcgCore.condition == OcgCore.Condition.Duel
&& !Config.GetBool("DuelCutin", true)) && !Config.GetBool("DuelCutin", true))
...@@ -183,16 +186,7 @@ namespace MDPro3.Servant ...@@ -183,16 +186,7 @@ namespace MDPro3.Servant
&& !Config.GetBool("ReplayCutin", true)) && !Config.GetBool("ReplayCutin", true))
return false; return false;
code = AliasCode(code); code = AliasCode(code);
bool returnValue = false; return cards.Any(c => c.Id == code);
foreach (var card in cards)
{
if (card.Id == code)
{
returnValue = true;
break;
}
}
return returnValue;
} }
private static int AliasCode(int code) private static int AliasCode(int code)
......
...@@ -26,7 +26,7 @@ namespace MDPro3.UI ...@@ -26,7 +26,7 @@ namespace MDPro3.UI
protected override void CallSubmitEvent() protected override void CallSubmitEvent()
{ {
AudioManager.PlaySE("SE_MENU_DECIDE"); AudioManager.PlaySE("SE_MENU_DECIDE");
if (CutinViewer.HasCutin(code)) if (CutinViewer.CutinExist(code))
_ = CutinViewer.Play(code, 0); _ = CutinViewer.Play(code, 0);
} }
protected override void CallToggleOnEvent() protected override void CallToggleOnEvent()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment