using Cysharp.Threading.Tasks;
using System.Collections.Generic;
using UnityEngine;

public class Bootstrap : SingletonMono<Bootstrap>
{
    public UIManager uiManager;
    public EventCenter eventCenter;
    public ScenesManager scenesManager;
    [Header("路径设置")]
    public string pptFolderName; // StreamingAssets下的文件夹名
    public string[] ppts;

    //string pptPath = Application.streamingAssetsPath + "/PPT/*.pptx/" ;
    protected override void Awake()
    {
        base.Awake();
        uiManager = new UIManager();
        eventCenter = new EventCenter();
        scenesManager = new ScenesManager();
        pptFolderName = Application.streamingAssetsPath + "/PPT";
        LoadPPTTest.PPTFiles(pptFolderName);
        ppts = LoadPPTTest.PPTName();
        DontDestroyOnLoad(gameObject);
    }

    private void Start()
    {
        uiManager.ShowPanel<UI_BGPanel>(this, E_UI_Layer.Bot, (panel) =>
        {
            Debug.Log("UI_StepsPanel已经显示在" + E_UI_Layer.Mid);
        });
        uiManager.ShowPanel<UI_MainTitlePanel>(this, E_UI_Layer.Bot, (panel) =>
        {
            Debug.Log("加载场景成功");
        });
        uiManager.ShowPanel<UI_SelectModePanel>(this, E_UI_Layer.Top, (panel) =>
        {
            Debug.Log("加载场景成功");
        });
        //uiManager.ShowPanel<UI_StepsPanel>(this, E_UI_Layer.System, (panel) =>
        //{
        //    Debug.Log("加载场景成功");
        //});
        //Debug.Log("<color=yellow>按键S显示UI,按键H关闭UI,按键E控制物体变色</color>");
        //uiManager.ShowPanel<UI_LoadingPanel>(this, E_UI_Layer.System, (panel) =>
        //{
        //    eventCenter.EventTrigger(Enum_EventType.UpdateProgress, 0.1f);
        //    scenesManager.LoadSceneAsyn(this, "TestScene", () =>
        //    {
        //        Debug.Log("加载场景成功");
        //        eventCenter.EventTrigger(Enum_EventType.UpdateProgress, 0.9f);
        //    });

        //});
    }

    // Update is called once per frame
    void Update()
    {


    }
}