I used Reset ResetTrigger() can’t cancel the SetTrigger.it will continue to be triggered.thanks!`
UnityEditorInternal.AnimatorController ac =
animator.runtimeAnimatorController as UnityEditorInternal.AnimatorController;
UnityEditorInternal.StateMachine sm = ac.GetLayer(0).stateMachine;
for (int i = 0; i < sm.stateCount; i++ )
{
animator.ResetTrigger(i);
}
animator.Play("idle");
animator.SetTrigger(animName);