Example #1
0
 /// <summary>
 /// Add a Move animation uses the local position and uses speed and not a duration.
 /// </summary>
 /// <param name="startPos">The local start position</param>
 /// <param name="endPos">The local end position to move to</param>
 /// <param name="speed">The speed of the animation. When the distance is 1 unity unit with the speed 1 it will take 1 seconds to animate.</param>
 /// <param name="easeFunction">The ease functions to use for the interpolation</param>
 /// <returns>it self</returns>
 public TransformAnimator LocalMoveWithSpeed(Vector3 startPos, Vector3 endPos, float speed, Func <float, float> easeFunction = null)
 {
     if (_disposed)
     {
         throw new ObjectDisposedException(this.name);
     }
     _sequences.Add(TransformAnimatorSpeedSequence.CreateLocalMoveAnimation(this, startPos, endPos, speed, easeFunction));
     return(this);
 }
Example #2
0
 /// <summary>
 /// Rotate the local transform which uses speed and not a duration.
 /// </summary>
 /// <param name="startRotaion">The start rotation</param>
 /// <param name="endRotation">The end rotation after the animation</param>
 /// <param name="speed">The speed of the animation.</param>
 /// <param name="easeFunction">The ease functions to use for the interpolation</param>
 /// <returns>it self</returns>
 public TransformAnimator LocalRotateWithSpeed(Quaternion startRotaion, Quaternion endRotation, float speed,
                                               Func <float, float> easeFunction = null)
 {
     if (_disposed)
     {
         throw new ObjectDisposedException(this.name);
     }
     _sequences.Add(TransformAnimatorSpeedSequence.CreateLocalRotaionAnimation(this, startRotaion,
                                                                               endRotation, speed, easeFunction));
     return(this);
 }