fix bug animation wound npc

This commit is contained in:
VDH
2025-10-14 14:57:19 +07:00
parent 5199df61f0
commit 4f06139b2e
13 changed files with 292 additions and 201 deletions
+10 -1
View File
@@ -5,14 +5,23 @@ using UnityEngine;
public class NPCVisual : MonoBehaviour
{
[SerializeField] NamedAnimancerComponent namedAnimancer;
#if UNITY_EDITOR
[SerializeField] bool isDebug;
public void DEBUG(string text)
{
if(!isDebug) return;
BMLogger.LogError(text);
}
#endif
public bool TryPlayAction(string animationName)
{
BMLogger.LogError("HoangDev: TryPlayAction: " + animationName);
DEBUG("HoangDev: TryPlayAction: " + animationName);
if (namedAnimancer == null) return false;
if (namedAnimancer.IsPlaying(animationName)) return false;
return namedAnimancer.TryPlay(animationName) == null;
}
public void InitNPCEventDoneHandler()
{
namedAnimancer = GetComponentInChildren<NamedAnimancerComponent>();