fix bug animation wound npc
This commit is contained in:
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user