// Use a blend of the results from two curves public static float Blend(EasingCurve curveA, EasingCurve curveB, float t, float blendValue) { float easedValueA = curveA.GetEasedValue(t); float easedValueB = curveB.GetEasedValue(t); return(easedValueA + (blendValue * (easedValueB - easedValueA))); }
// Blend between two curves based on the value of t public static float CrossFade(EasingCurve curveA, EasingCurve curveB, float t) { float easedValueA = curveA.GetEasedValue(t); float easedValueB = curveB.GetEasedValue(t); return(((1 - t) * easedValueA) + (t * easedValueB)); }
// Multiple the result of one curve by another public static float Multiply(EasingCurve curveA, EasingCurve curveB, float t) { return(curveA.GetEasedValue(t) * curveB.GetEasedValue(t)); }
// Use the result of one curve as the parameter for another public static float Compose(EasingCurve curveA, EasingCurve curveB, float t) { return(curveA.GetEasedValue(curveB.GetEasedValue(t))); }
// Utility functions for creating new curves // Invert the result of curve (1 - x) public static float Invert(EasingCurve curve, float t) { return(1 - curve.GetEasedValue(t)); }