using System.Threading.Tasks;
using UnityEngine;

namespace WS
{
    public class UIGuideOperateComponent : OperateComponent<UIGuideOperateData>
    {
        ///<summary>音频实例</summary>
        private VoiceEntity Voice;

        public override void Init() { }

        public override void StartOperate()
        {
            ChoosePopController choosePop =
                FacadeComponent.Instance.CreateController<ChoosePopController>();
            choosePop.OpenView();
            choosePop.SetGuide(() =>
            {
                IsComplete = true;
            });
        }

        public override Task StartState()
        {
            FacadeComponent.Instance.GetController<ChoosePopController>().CloseView();
            IsComplete = false;
            return Task.CompletedTask;
        }

        public override Task EndState()
        {
            FacadeComponent.Instance.GetController<ChoosePopController>().CloseView();
            IsComplete = true;
            return Task.CompletedTask;
        }

        public override void Update() { }

        public override void Dispose()
        {
            base.Dispose();
        }
    }

    public class UIGuideOperateData
    {
        public Vector3 pos;
        public string audioName;
    }
}
