animation npc Process
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user