iFactory.Cutting.Unity/Assets/BITKit/Unity/Scripts/Animator/AnimatorHelper.cs

26 lines
805 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BITKit
{
public class AnimatorHelper : MonoBehaviour
{
[SerializeField] private Transform root;
private void OnAnimatorMove()
{
if (root)
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);
}
}
}