13 #region Exponential Decay 15 public static float ExpDecay(
float from,
float to,
float hLife,
float dTime)
17 return Mathf.Lerp(from, to, ExpCoefficient(hLife, dTime));
20 public static Vector2
ExpDecay(Vector2 from, Vector2 to,
float hLife,
float dTime)
22 return Vector2.Lerp(from, to, ExpCoefficient(hLife, dTime));
25 public static Vector3
ExpDecay(Vector3 from, Vector3 to,
float hLife,
float dTime)
27 return Vector3.Lerp(from, to, ExpCoefficient(hLife, dTime));
30 public static Quaternion
ExpDecay(Quaternion from, Quaternion to,
float hLife,
float dTime)
32 return Quaternion.Slerp(from, to, ExpCoefficient(hLife, dTime));
35 public static Color
ExpDecay(Color from, Color to,
float hLife,
float dTime)
37 return Color.Lerp(from, to, ExpCoefficient(hLife, dTime));
46 return 1.0f - Mathf.Pow(0.5f, dTime / hLife);