private static float EaseP( float u, EasingCachedCurve ec ) { float u2 = u; for (int i=0; i<ec.curves.Count; i++) { u2 = EaseP( u2, ec.curves[i], ec.mods[i] ); } return( u2 ); }
static private float EaseP(float u, EasingCachedCurve ec) { float u2 = u; for (int i = 0; i < ec.curves.Count; i++) { u2 = EaseP(u2, ec.curves[i], ec.mods[i]); } return(u2); }
private static void EaseParse( string curveIn ) { EasingCachedCurve ecc = new EasingCachedCurve(); // It's possible to pass in several comma-separated curves string[] curves = curveIn.Split(','); foreach (string curve in curves) { if (curve == "") continue; // Split each curve on | to find curve and mod string[] curveA = curve.Split('|'); ecc.curves.Add(curveA[0]); if (curveA.Length == 1 || curveA[1] == "") { ecc.mods.Add(float.NaN); } else { float parseRes; if ( float.TryParse(curveA[1], out parseRes) ) { ecc.mods.Add( parseRes ); } else { ecc.mods.Add( float.NaN ); } } } cache.Add(curveIn, ecc); }
static private void EaseParse(EasingCurve curveIn) { EasingCachedCurve ecc = new EasingCachedCurve(); CASHE.Add(curveIn, ecc); }