2024-01-23 02:56:26 +08:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
namespace BITKit
|
|
|
|
{
|
|
|
|
public class AnimatorHelper : MonoBehaviour
|
|
|
|
{
|
|
|
|
[SerializeField] private Transform root;
|
|
|
|
|
|
|
|
private void OnAnimatorMove()
|
|
|
|
{
|
|
|
|
if (root)
|
2024-04-16 04:15:06 +08:00
|
|
|
root.SendMessageUpwards(nameof(OnAnimatorMove),SendMessageOptions.DontRequireReceiver);
|
2024-01-23 02:56:26 +08:00
|
|
|
}
|
|
|
|
private void AIAnimationEvent(string actionName)
|
|
|
|
{
|
|
|
|
if (root)
|
2024-04-16 04:15:06 +08:00
|
|
|
root.SendMessage(nameof(AIAnimationEvent), actionName,SendMessageOptions.DontRequireReceiver);
|
|
|
|
}
|
|
|
|
public void AnimationEvent(string eventName)
|
|
|
|
{
|
|
|
|
if(root)
|
|
|
|
root.SendMessage(nameof(AnimationEvent), eventName,SendMessageOptions.DontRequireReceiver);
|
2024-01-23 02:56:26 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|