清除缓存

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