animation npc Process

This commit is contained in:
VDH
2025-09-29 18:26:02 +07:00
parent 586e2f834b
commit 1b2de221b4
18 changed files with 825 additions and 52 deletions
+8 -4
View File
@@ -4,7 +4,7 @@ using UnityEngine;
public class PlayerVisual : MonoBehaviour
{
[SerializeField] NamedAnimancerComponent animancer;
[SerializeField] NamedAnimancerComponent namedAnimancer;
[SerializeField] private INFO _playerInfo;
@@ -12,13 +12,13 @@ public class PlayerVisual : MonoBehaviour
private void PlayActionEventHandler(PlayActionEvent @event)
{
BrewMonster.Logger.Log("PlayActionEventHandler : "+@event.AnimationName);
animancer.TryPlay(@event.AnimationName);
namedAnimancer.TryPlay(@event.AnimationName);
}
public void InitHostPlayerEventDoneHandler()
{
animancer = GetComponentInChildren<NamedAnimancerComponent>();
if(animancer == null)
namedAnimancer = GetComponentInChildren<NamedAnimancerComponent>();
if(namedAnimancer == null)
{
BrewMonster.Logger.LogError("animancer == null");
return;
@@ -36,4 +36,8 @@ public class PlayerVisual : MonoBehaviour
{
EventBus.UnsubscribeAllInChannel(_playerInfo.cid);
}
public bool IsAnimationExist(string animationName)
{
return namedAnimancer.States.TryGet("ActionName", out var existingState) ? true : false;
}
}