bool IsHaveTargetEvent(GameObject go, string triggerName)
{
Animator animator = go.GetComponentInChildren<Animator>();
Debug.Assert(animator != null, string.Format("{0} 缺少 Animator Com", go.name));
if (animator == null)
{
return false;
}
UnityEditor.Animations.AnimatorController controller = animator.runtimeAnimatorController as UnityEditor.Animations.AnimatorController;
Debug.Assert(controller != null, string.Format("{0} 缺少 animator controller", go.name));
if (controller == null)
{
return false;
}
UnityEditor.Animations.AnimatorStateMachine baseStateMachine = controller.layers[0].stateMachine;
foreach (UnityEditor.Animations.AnimatorStateTransition t in baseStateMachine.anyStateTransitions)
{
foreach (UnityEditor.Animations.AnimatorCondition c in t.c
Unity3D 获得 Animator 的 Trigger 和 Event
最新推荐文章于 2024-06-06 16:03:40 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)