示例#1
0
    /// <summary>
    /// 进入主场景
    /// </summary>
    public void SwitchToMain(bool loading = true, Callback callback = null)
    {
//#if CHAPTER_ONE
//        if (loading && !ConfigDataMgr.instance.gameConfig.ios_audit)
//#elif CHAPTER_TWO
        if (loading)
//#endif
        {
            UILoadingWindow uiLoadingWindow = UIManager.Instance.OpenUI <UILoadingWindow>();
            AsyncOperation  async           = SceneManager.LoadSceneAsync(MainScene);
            uiLoadingWindow.InitWith(async, () =>
            {
                UIManager.Instance.OpenUI <UIMainWindow>();

                if (callback != null)
                {
                    callback();
                }
            });
        }
        else
        {
            SceneManager.LoadScene(MainScene);

            UIManager.Instance.OpenUI <UIMainWindow>();
            if (callback != null)
            {
                callback();
            }
        }
    }
示例#2
0
    public void SwitchToExam()
    {
        AsyncOperation  async           = SceneManager.LoadSceneAsync("ExamScene");
        UILoadingWindow uiLoadingWindow = UIManager.Instance.OpenUI <UILoadingWindow>();

        uiLoadingWindow.InitWith(async);
    }