Beispiel #1
0
    public void RealLoadScene(SceneName name, PanelLoading ui)
    {
        ui.SetUI(LoadingType.Scene);
        AsyncOperation op       = null;
        Action         callback = () => { };

        switch (name)
        {
        case SceneName.A_SceneEnter:
            break;

        case SceneName.B_SceneLoading:
            op       = SceneManager.LoadSceneAsync("B_SceneLoading");
            callback = OnEnterSceneLoading;
            break;

        case SceneName.C_SceneLogin:
            op       = SceneManager.LoadSceneAsync("C_SceneLogin");
            callback = OnEnterSceneLogin;
            break;

        case SceneName.D_SceneGameInit:
            break;

        case SceneName.E_SceneGame_1:
            op       = SceneManager.LoadSceneAsync("E_SceneGame_1");
            callback = OnEnterSceneGame1;
            break;

        case SceneName.F_SceneGame_2:
            break;
        }
        StartCoroutine(Loading(op, callback, ui));
    }
Beispiel #2
0
        private void LoadResource()
        {
            ui.SetUI(LoadingType.Scene);
            string hostFileURL = string.Empty;

            foreach (var file in _willLoadList)
            {
                if (file.type == "bundle")
                {
                    hostFileURL = URL.ASSETBUNDLE_HOST_URL + file.name;
                }
                if (file.type == "lua")
                {
                    hostFileURL = URL.LUA_HOST_URL + file.name;
                }

                Debug.Log(string.Format("Save {0} to {1}", file.name, URL.ASSETBUNDLE_LOCAL_URL));
                Loader loader = new Loader(hostFileURL, URL.ASSETBUNDLE_LOCAL_URL + file.name, this.ui);
                _loaderQueue.Enqueue(loader);
            }
        }