Internal_UpdateTangents() private static method

private static Internal_UpdateTangents ( AnimationCurve curve, int index ) : void
curve AnimationCurve
index int
return void
示例#1
0
 internal static void UpdateTangentsFromMode(AnimationCurve curve)
 {
     for (int i = 0; i < curve.length; i++)
     {
         AnimationUtility.Internal_UpdateTangents(curve, i);
     }
 }
示例#2
0
 internal static void UpdateTangentsFromModeSurrounding(AnimationCurve curve, int index)
 {
     AnimationUtility.Internal_UpdateTangents(curve, index - 2);
     AnimationUtility.Internal_UpdateTangents(curve, index - 1);
     AnimationUtility.Internal_UpdateTangents(curve, index);
     AnimationUtility.Internal_UpdateTangents(curve, index + 1);
     AnimationUtility.Internal_UpdateTangents(curve, index + 2);
 }
示例#3
0
        public static void SetKeyRightTangentMode(AnimationCurve curve, int index, AnimationUtility.TangentMode tangentMode)
        {
            if (curve == null)
            {
                throw new ArgumentNullException("curve");
            }
            if (index < 0 || index >= curve.length)
            {
                return;
            }
            Keyframe key = curve[index];

            if (tangentMode != AnimationUtility.TangentMode.Free)
            {
                key.tangentMode |= AnimationUtility.kBrokenMask;
            }
            key.tangentMode &= ~AnimationUtility.kRightTangentMask;
            key.tangentMode |= (int)((int)tangentMode << 3);
            curve.MoveKey(index, key);
            AnimationUtility.Internal_UpdateTangents(curve, index);
        }
示例#4
0
        public static void SetKeyBroken(AnimationCurve curve, int index, bool broken)
        {
            if (curve == null)
            {
                throw new ArgumentNullException("curve");
            }
            if (index < 0 || index >= curve.length)
            {
                return;
            }
            Keyframe key = curve[index];

            if (broken)
            {
                key.tangentMode |= AnimationUtility.kBrokenMask;
            }
            else
            {
                key.tangentMode &= ~AnimationUtility.kBrokenMask;
            }
            curve.MoveKey(index, key);
            AnimationUtility.Internal_UpdateTangents(curve, index);
        }