CSharp examples for System:Math Easing Function
cubic Ease In Out
using System.Collections; using UnityEngine; public class Main{ public static float cubicInOut(float currentTime,float startValue,float changeInValue,float duration) { currentTime /= duration/2;/*w w w .j a v a 2s . c o m*/ if (currentTime < 1) return changeInValue/2*currentTime*currentTime*currentTime + startValue; currentTime -= 2; return changeInValue/2*(currentTime*currentTime*currentTime + 2) + startValue; } }