IEnumerator Start()
    {
        yield return(CustomSceneManager.WaitForSceneLoadedOrUnloaded(toLoad));

        if (CustomSceneManager.IsSceneUnloaded(toLoad))
        {
            yield return(CustomSceneManager.LoadSceneAsync(toLoad, LoadSceneMode.Additive));
        }
    }
Пример #2
0
    public IEnumerator RequestLoad()
    {
        numLoadRequests++;
        yield return(CustomSceneManager.WaitForSceneLoadedOrUnloaded(sceneToLoad));

        if (numLoadRequests > 0 && CustomSceneManager.IsSceneUnloaded(sceneToLoad))
        {
            yield return(CustomSceneManager.LoadSceneAsync(sceneToLoad, LoadSceneMode.Additive));
        }
    }
Пример #3
0
    IEnumerator Start()
    {
        yield return(CustomSceneManager.WaitForSceneLoadedOrUnloaded(playerScene));

        if (CustomSceneManager.IsSceneUnloaded(playerScene))
        {
            yield return(CustomSceneManager.LoadSceneAsync(playerScene, LoadSceneMode.Additive));

            GameObject player = GameObject.FindWithTag("Player");
            player.transform.position = transform.position;
        }
    }
Пример #4
0
        static int _m_LoadSceneAsync(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                CustomSceneManager gen_to_be_invoked = (CustomSceneManager)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable <System.Action <int> >(L, 3))
                {
                    string _sceneName           = LuaAPI.lua_tostring(L, 2);
                    System.Action <int> _action = translator.GetDelegate <System.Action <int> >(L, 3);

                    gen_to_be_invoked.LoadSceneAsync(_sceneName, _action);



                    return(0);
                }
                if (gen_param_count == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
                {
                    string _sceneName = LuaAPI.lua_tostring(L, 2);

                    gen_to_be_invoked.LoadSceneAsync(_sceneName);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to CustomSceneManager.LoadSceneAsync!"));
        }