清除缓存

This commit is contained in:
wulongxiao 2025-01-09 13:07:52 +08:00
parent e79bd2ada7
commit a187c6ecc7

View File

@ -6,6 +6,7 @@ using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using DG.Tweening; using DG.Tweening;
using TMPro; using TMPro;
using Debug = UnityEngine.Debug;
public enum Camp public enum Camp
{/// <summary> {/// <summary>
@ -281,6 +282,13 @@ public class Role : Fun
{ {
while (true) while (true)
{ {
if (hp < 0)
{
Debug.LogError("!!!!!!!!!!!跳过while");
return;
}
if (AnimationTree.Count == 0) if (AnimationTree.Count == 0)
{ {
isAnimationPlay = false; isAnimationPlay = false;
@ -318,6 +326,13 @@ public class Role : Fun
if (animationHighlight >= 0 && animationHighlight < AnimationTree.Count) if (animationHighlight >= 0 && animationHighlight < AnimationTree.Count)
{ {
if (hp < 0)
{
Debug.LogError("@@@@@@@@@@@@跳过while");
return;
}
OnAnimationIng?.Invoke(animationHighlight); OnAnimationIng?.Invoke(animationHighlight);
await Task.Delay(AnimationTree[animationHighlight].CharacterAnimationFrameInterval); await Task.Delay(AnimationTree[animationHighlight].CharacterAnimationFrameInterval);
} }
@ -343,9 +358,9 @@ public class Role : Fun
SpawnMonster.intance.Index += 1; SpawnMonster.intance.Index += 1;
} }
Destroy(gameObject); Destroy(this.gameObject);
Destroy(this); //Destroy(this);
//IsDead = true;
} }
if (lsanimationHighlight == hitIndex) if (lsanimationHighlight == hitIndex)
@ -719,4 +734,9 @@ public class Role : Fun
//UnityEngine.Debug.Log("破甲关系:" + "萌妖" + AttackType + "::" + "敌人" + Target.defenseType + "伤害加成" + relation); //UnityEngine.Debug.Log("破甲关系:" + "萌妖" + AttackType + "::" + "敌人" + Target.defenseType + "伤害加成" + relation);
return relation; return relation;
} }
void OnDestroy()
{
this.AnimationTree = null;
}
} }