using UnityEngine; namespace AlicizaX.AnimationFlow.Runtime { [Category("Animation")] [System.Serializable] public class TranslateTo : AnimationBaseNode { public Transform target; public override void OnInit() { orgValue = target.localPosition; } public override void OnReset() { target.localPosition = orgValue; } public override void OnEnter() { if (setFrom) { target.localPosition = from; } enterValue = target.localPosition; } public override void OnUpdate(float dt) { target.localPosition = Easing.Ease(easyType, enterValue, to, elapsedTime / duration); } public override bool Valid() { Debug.Log(target != null && duration > 0); return target != null && duration > 0; } public override float Duration() { return duration; } public override bool HasSubTitle() { return true; } public override string SubTitle() { return target != null ? target.name : null; } } }