Exemple #1
0
    /*
     * Start is called before the first frame update.
     * We use it to gether the required components and set default variables.
     */
    private void Start()
    {
        rb       = GetComponent <Rigidbody2D>();
        animator = GetComponent <EasyAnimate>();

        target = CharacterManager.player.transform;
    }
 /// <param name="pStartValue"></param>
 /// <param name="pEndValue"></param>
 /// <param name="pSpeed">uints per second</param>
 /// <param name="pSetter"></param>
 /// <returns></returns>
 public static EasyAnimate.State<float> FloatWithSpeed(float pStartValue, float pEndValue, float pSpeed, EasyAnimate.State<float>.EAInterpolate pInterpolator = null, EasyAnimate.State<float>.EASetter pSetter = null, Action pOnComplete = null)
 {
     return new EasyAnimate.State<float>() {
         startTime = Time.time,
         length = Mathf.Abs(pEndValue - pStartValue) / pSpeed,
         startValue = pStartValue,
         endValue = pEndValue,
         onCompleted = pOnComplete,
         interpolator = Mathf.Lerp,
         setter = pSetter,
     };
 }