using UnityEngine;

namespace Assets.Source.UI
{
    public enum UIAnimationTrigger
    {
        Open,
        Close
    }

    public abstract class UIAnimation : MonoBehaviour
    {
        void Awake()
        {
            VAwake();
        }

        public void Trigger(UIAnimationTrigger trigger)
        {
            HandleTrigger(trigger);
        }

        public abstract void EndInstantly();
        protected abstract void HandleTrigger(UIAnimationTrigger trigger);
        protected virtual void VAwake() { }

        public virtual float GetInDuration()
        {
            return -1;
        }
        public virtual float GetOutDuration()
        {
            return -1;
        }
    }
}
