cubic Ease In Out - CSharp System

CSharp examples for System:Math Easing Function

Description

cubic Ease In Out

Demo Code


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;
    }
}

Related Tutorials