protected override void Initialize() { AnimatorEffect tweenX = new TweenFX_X(float.NaN, _endX, _duration, _easingFunctX, _type); AnimatorEffect tweenY = new TweenFX_Y(float.NaN, _endY, _duration, _easingFunctY, _type); _effects = new List <AnimatorEffect> { tweenX, tweenY }; base.Initialize(); }
protected override void Initialize() { Transform trasform = _target.GetComponent <Transform>(); float duration = Distance(trasform.localPosition.x, trasform.localPosition.y, _endX, _endY) / _velocity; AnimatorEffect tweenX = new TweenFX_X(float.NaN, _endX, duration, _easingFunctX, _type); AnimatorEffect tweenY = new TweenFX_Y(float.NaN, _endY, duration, _easingFunctY, _type); _effects = new List <AnimatorEffect> { tweenX, tweenY }; base.Initialize(); }