void PlayTransientAnimation(AnimationWithSound animation, Action onComplete) { var state = Animator.state.GetCurrent(AnimationTrack); if (state.Animation.Name != Parameters.StandardIdle) { return; } animation.Play(_audioSource, Animator.state, AnimationTrack, false, subscriptions: new AnimationEventSubscriptions { OnComplete = () => { Animator.state.SetAnimation(AnimationTrack, _standardIdleAnimation, true); onComplete(); } } ); }
public void PlayTransientAnimation(AnimationWithSound animation, AnimationEventSubscriptions events = null) { var subscriptions = CreateNotifyControllerOfAnimationEndSubscription(events); animation.Play(_audioSource, _skeletonAnimation.state, _transientAnimationTrack, false, subscriptions); }