using UnityEngine; namespace AlicizaX.AnimationFlow.Runtime { [Category("RectTransform")] public class UISizeDelta : ActionNode { public float duration = 1f; public EaseType easyType; public RectTransform target; public bool setFrom; public Vector2 from; public Vector2 to; protected Vector2 orgValue; protected Vector2 enterValue; public override void OnInit() { orgValue = target.sizeDelta; } public override void OnReset() { target.sizeDelta = orgValue; } public override void OnEnter() { if (setFrom) { target.sizeDelta = from; } if (Condition()) { target.sizeDelta = to; } enterValue = target.sizeDelta; } public override void OnUpdate(float dt) { target.sizeDelta = Easing.Ease(easyType, enterValue, to, elapsedTime / duration); } public override bool Valid() { return target != null; } public override float Duration() { return duration; } public override bool HasSubTitle() { return true; } public override string SubTitle() { return target != null ? target.name : null; } } }