Files
CortexCore c1f51826b3 1
2024-04-22 03:48:37 +08:00

26 lines
882 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BITKit
{
public class AnimatorHelper : MonoBehaviour
{
[SerializeField] private Transform root;
[SerializeField] private bool allowAnimatorMove;
private void OnAnimatorMove()
{
if (root && allowAnimatorMove)
root.SendMessageUpwards(nameof(OnAnimatorMove),SendMessageOptions.DontRequireReceiver);
}
private void AIAnimationEvent(string actionName)
{
if (root)
root.SendMessage(nameof(AIAnimationEvent), actionName,SendMessageOptions.DontRequireReceiver);
}
public void AnimationEvent(string eventName)
{
if(root)
root.SendMessage(nameof(AnimationEvent), eventName,SendMessageOptions.DontRequireReceiver);
}
}
}