UnityEngine.AnimationCurve.MoveKey C# (CSharp) Method

MoveKey() public method

Removes the keyframe at index and inserts key.

public MoveKey ( int index, Keyframe key ) : int
index int The index of the key to move.
key Keyframe The key (with its new time) to insert.
return int
        public int MoveKey(int index, Keyframe key)
        {
            return INTERNAL_CALL_MoveKey(this, index, ref key);
        }

Usage Example

		public static void SetLinear(ref AnimationCurve curve) {

			for (int i = 0; i < curve.length; i++) {

				Keyframe boxed = curve.keys[i]; // getting around the fact that Keyframe is a struct by pre-boxing
				boxed.tangentMode = GetNewTangentKeyMode(boxed.tangentMode, TangentDirection.Left, TangentMode.Linear);
				boxed.tangentMode = GetNewTangentKeyMode(boxed.tangentMode, TangentDirection.Right, TangentMode.Linear);
				curve.MoveKey(i, (Keyframe)boxed);
				curve.SmoothTangents(i, 0f);

			}

		}
All Usage Examples Of UnityEngine.AnimationCurve::MoveKey