using System.Threading.Tasks;
using UnityEngine;
using WS;

public class ShowMsgComponent : OperateComponent<ShowMsgData>
{
    /// <summary> 当前时间 </summary>
    private float currentTime = 0;

    ///// <summary> 弹窗控制器 </summary>
    //private TipPopController tipPop;
    public override void Init()
    {
        currentTime = OperateData.time;
    }

    public override void StartOperate()
    {
        //tipPop = FacadeComponent.Instance.CreateController<TipPopController>();
        //tipPop.OpenView();
        //tipPop.SetView(OperateData.pos/0.001f, Quaternion.Euler(OperateData.rot), OperateData.msg);
        //TimerComponent.Instance.Wait(OperateData.time, () =>
        //{
        //    IsComplete = true;
        //    tipPop.CloseView();
        //});
    }

    public override Task StartState()
    {
        return Task.CompletedTask;
    }

    public override Task EndState()
    {
        return Task.CompletedTask;
    }

    public override void Update() { }
}

public class ShowMsgData
{
    /// <summary> 位置点 </summary>
    public string showPointName;

    /// <summary> 位置 </summary>
    public Vector3 pos;

    /// <summary> 旋转 </summary>
    public Vector3 rot;

    /// <summary> 弹窗信息 </summary>
    public string msg;

    /// <summary> 显示时间 </summary>
    public float time;
}
