Example #1
0
 /// <summary>
 /// Tweens us toward another transform over time.
 /// </summary>
 /// <param name="newTarget">Transform to chase.</param>
 /// <param name="duration">Tween duration.</param>
 public void SwitchTarget(Transform newTarget, float duration = 1f)
 {
     OnSwitchTarget();
     lastTarget = target;
     target     = newTarget;
     tween.Reset(duration);
 }
Example #2
0
 /// <summary>
 /// Tween to another CamState delegate over time.
 /// </summary>
 /// <param name="inStateFunc">CamState delegate to switch to.</param>
 /// <param name="duration">Tween duration (in seconds).</param>
 protected void SwitchFunc(System.Func <CamState, CamState> inStateFunc, float duration = 1f)
 {
     SnapFunc(inStateFunc);
     tween.Reset(duration);
 }