Commit 7c9d1d2e authored by SherryChaos's avatar SherryChaos

bug fix

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