示例#1
0
 /// <summary>
 ///     Instantiates and initializes class fields. Used in OnEnable().
 /// </summary>
 private void HandleInitializeReferenceTypes()
 {
     if (animatedObjectPath == null)
     {
         animatedObjectPath = new AnimationPath();
         InitializeAnimatedObjectPath();
     }
     if (rotationPath == null)
     {
         rotationPath = new AnimationPath();
     }
     if (easeCurve == null)
     {
         easeCurve = new AnimationCurve();
         InitializeEaseCurve();
     }
     if (tiltingCurve == null)
     {
         tiltingCurve = new AnimationCurve();
         InitializeTiltingCurve();
     }
     if (EaseToolState == null)
     {
         EaseToolState = new List <bool> {
             true, true
         };
     }
     if (TiltingToolState == null)
     {
         TiltingToolState = new List <bool> {
             true, true
         };
     }
 }
示例#2
0
        // todo rename to ForceInstantiateFields
        private void ForceInstantiatePathsAndCurves()
        {
            animatedObjectPath = new AnimationPath();
            rotationPath       = new AnimationPath();
            easeCurve          = new AnimationCurve();
            tiltingCurve       = new AnimationCurve();

            EaseToolState    = new List <bool>();
            TiltingToolState = new List <bool>();
        }
示例#3
0
 /// <summary>
 ///     Smooth tangents in all nodes in all animation curves.
 /// </summary>
 /// <param name="path"></param>
 /// <param name="weight">Weight to be applied to the tangents.</param>
 public void SmoothAnimationPathTangents(
     AnimationPath path,
     float weight = 0)
 {
     // For each key..
     for (var j = 0; j < NodesNo; j++)
     {
         path.SmoothNodeInOutTangents(j, DefaultSmoothWeight);
     }
 }
示例#4
0
        public void ResetRotationPath()
        {
            rotationPath = new AnimationPath();

            UpdateRotationPathWithAddedKeys();
            ResetRotationPathValues();
            SmoothAllRotationPathNodes();

            OnRotationPathReset();
        }