public float Step()
 {
     if (config.interpolationType == Config.InterpolationType.Exponential)
     {
         currentValue = ETween.Step(
             currentValue, targetValue, config.interpolationSpeed);
     }
     else if (config.interpolationType == Config.InterpolationType.DampedSpring)
     {
         currentValue = DTween.Step(
             currentValue, targetValue, ref _velocity, config.interpolationSpeed);
     }
     else
     {
         currentValue = targetValue;
     }
     return(currentValue);
 }
Exemple #2
0
 void Update()
 {
     if (_interpolator == Interpolator.Exponential)
     {
         if (_positionSpeed > 0)
         {
             transform.position = ETween.Step(transform.position, target.position, _positionSpeed);
         }
         if (_rotationSpeed > 0)
         {
             transform.rotation = ETween.Step(transform.rotation, target.rotation, _rotationSpeed);
         }
     }
     else if (_interpolator == Interpolator.DampedSpring)
     {
         if (_positionSpeed > 0)
         {
             transform.position = DTween.Step(transform.position, target.position, ref _vposition, _positionSpeed);
         }
         if (_rotationSpeed > 0)
         {
             transform.rotation = DTween.Step(transform.rotation, target.rotation, ref _vrotation, _rotationSpeed);
         }
     }
     else
     {
         if (_positionSpeed > 0)
         {
             transform.position = SpringPosition(transform.position, target.position);
         }
         if (_rotationSpeed > 0)
         {
             transform.rotation = SpringRotation(transform.rotation, target.rotation);
         }
     }
 }
Exemple #3
0
 public void Step(Quaternion target)
 {
     rotation = DTween.Step(rotation, target, ref velocity, omega);
 }
Exemple #4
0
 public void Step(Vector3 target)
 {
     position = DTween.Step(position, target, ref velocity, omega);
 }