using Assets.Source.Content.UI.Dialogues;
using Assets.Source.UI;
using UnityEngine.Video;

namespace Assets.Source.Content.UI.Topdown
{
    public class UIVideoDialogue : UIBaseDialogue
    {
        public VideoPlayer VideoPlayer;

        protected override void VOpen(IUIElementProperties properties, bool instantly)
        {
            base.VOpen(properties, instantly);
            VideoPlayer.Play();
            this.After((float)VideoPlayer.length - GetCloseDuration(), () => Close());
            if (Get.DebugSettings.SkipVideo)
                Close();
        }
    }
}
