fix bug endless loop
This commit is contained in:
@@ -24,13 +24,19 @@ namespace BrewMonster
|
||||
public List<CECAttackEvent> m_AttackList = new List<CECAttackEvent>();
|
||||
#endif
|
||||
private void Start()
|
||||
{
|
||||
StartLoad();
|
||||
}
|
||||
private async Task StartLoad()
|
||||
{
|
||||
SetupAttacksMan();
|
||||
|
||||
uint idSkill = 0;
|
||||
|
||||
while (true)
|
||||
//int count = 0;
|
||||
while (true/*count >=200*/)
|
||||
{
|
||||
//count++;
|
||||
idSkill = ElementSkill.NextSkill(idSkill);
|
||||
if (idSkill == 0)
|
||||
break;
|
||||
@@ -45,8 +51,8 @@ namespace BrewMonster
|
||||
szSGCFile = "nosuchthing";
|
||||
else
|
||||
szSGCFile = $"{pszSGCFile}";*/
|
||||
|
||||
if (!m_pSkillGfxComposerMan.LoadOneComposer((int)idSkill, flyGFXPath, hitGrdGFXPath, hitGFXPath))
|
||||
var isLoaded = await m_pSkillGfxComposerMan.LoadOneComposer((int)idSkill, flyGFXPath, hitGrdGFXPath, hitGFXPath);
|
||||
if (!isLoaded)
|
||||
{
|
||||
// a_LogOutput(1, "CECAttacksMan::CECAttacksMan(), failed to load skill [%d]'s gfx composer [%s]", idSkill, szSGCFile);
|
||||
}
|
||||
@@ -404,15 +410,31 @@ namespace BrewMonster
|
||||
hitGfxName = hitGFXPath;
|
||||
hitGrdGfxName = hitGrdGFXPath;
|
||||
#endif
|
||||
|
||||
flyGFX = await AddressableManager.Instance.LoadPrefabAsync("gfx/" + flyGfxName);
|
||||
hitGFX = await AddressableManager.Instance.LoadPrefabAsync("gfx/" + hitGfxName);
|
||||
hitGrdGFX = await AddressableManager.Instance.LoadPrefabAsync("gfx/" + hitGrdGfxName);
|
||||
if (flyGfxName != string.Empty)
|
||||
{
|
||||
flyGFX = await AddressableManager.Instance.LoadPrefabAsync("gfx/" + flyGfxName);
|
||||
}
|
||||
if (hitGfxName != string.Empty)
|
||||
{
|
||||
hitGFX = await AddressableManager.Instance.LoadPrefabAsync("gfx/" + hitGfxName);
|
||||
}
|
||||
if (hitGrdGfxName != string.Empty)
|
||||
{
|
||||
hitGrdGFX = await AddressableManager.Instance.LoadPrefabAsync("gfx/" + hitGrdGfxName);
|
||||
}
|
||||
//BMLogger.LogError("HoangDev: Load A3DSkillGfxComposer GFX name: " + name);
|
||||
if (flyGFX == null)
|
||||
{
|
||||
flyGFX = Resources.Load<GameObject>("GFX/" + "PlaceHolder");
|
||||
}
|
||||
if (hitGFX == null)
|
||||
{
|
||||
hitGFX = Resources.Load<GameObject>("GFX/" + "PlaceHolder");
|
||||
}
|
||||
if (hitGrdGFX == null)
|
||||
{
|
||||
hitGrdGFX = Resources.Load<GameObject>("GFX/" + "PlaceHolder");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public void SpawnGFX(long IDTarget)
|
||||
|
||||
@@ -8,6 +8,7 @@ namespace BrewMonster
|
||||
public static void Init()
|
||||
{
|
||||
int i = 0;
|
||||
i++;
|
||||
}
|
||||
// Skill stub declarations
|
||||
public static Skill1Stub __stub_Skill1Stub = new Skill1Stub();
|
||||
|
||||
@@ -206,9 +206,9 @@ namespace BrewMonster.Scripts.Skills
|
||||
public int combosk_nobreak;
|
||||
|
||||
public string effect;
|
||||
public string m_szFlyGfxPath;
|
||||
public string m_szHitGrndGfxPath;
|
||||
public string m_szHitGfxPath;
|
||||
public string m_szFlyGfxPath = string.Empty;
|
||||
public string m_szHitGrndGfxPath = string.Empty;
|
||||
public string m_szHitGfxPath = string.Empty;
|
||||
public string aerial_effect;
|
||||
|
||||
public Range range;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using BrewMonster.Network;
|
||||
using BrewMonster.Scripts;
|
||||
|
||||
@@ -8,13 +9,15 @@ namespace BrewMonster
|
||||
{
|
||||
private readonly Dictionary<int, A3DSkillGfxComposer> m_ComposerMap = new Dictionary<int, A3DSkillGfxComposer>();
|
||||
|
||||
public bool LoadOneComposer(int nSkillID, string flyGFXPath, string hitGrdGFXPath, string hitGFXPath)
|
||||
public async Task<bool> LoadOneComposer(int nSkillID, string flyGFXPath, string hitGrdGFXPath, string hitGFXPath)
|
||||
{
|
||||
if (m_ComposerMap.ContainsKey(nSkillID))
|
||||
return false;
|
||||
|
||||
var composer = new A3DSkillGfxComposer();
|
||||
if (!composer.Load(flyGFXPath, hitGrdGFXPath, hitGFXPath).Result)
|
||||
var isLoaded = await composer.Load(flyGFXPath, hitGrdGFXPath, hitGFXPath);
|
||||
|
||||
if (!isLoaded)
|
||||
{
|
||||
// failed to load
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:372d7ab9403489b166ae403a24c6bbde8a88e2a995c20f2eb735977a64d8b2b8
|
||||
size 200526718
|
||||
oid sha256:7f3b2fa458492b87f3d3d5fa70db3021c8d12fd7863ea8cd0ac6ede2055e32e7
|
||||
size 200528050
|
||||
|
||||
+90
-9
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user