UnityEditor.Animations.AnimatorControllerLayer.GetOverrideMotion C# (CSharp) Method

GetOverrideMotion() public method

Gets the override motion for the state on the given layer.

public GetOverrideMotion ( AnimatorState state ) : Motion
state AnimatorState The state which we want to get the motion.
return UnityEngine.Motion
        public Motion GetOverrideMotion(AnimatorState state)
        {
            if (this.m_Motions != null)
            {
                foreach (StateMotionPair pair in this.m_Motions)
                {
                    if (pair.m_State == state)
                    {
                        return pair.m_Motion;
                    }
                }
            }
            return null;
        }