Ejemplo n.º 1
0
 static int LoadSceneSuccess(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
         LuaSceneTool.LoadSceneSuccess(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 2
0
    IEnumerator LoadScene()
    {
        mLoadAsync = SceneManager.LoadSceneAsync(mTargetSceneIndex, LoadSceneMode.Additive);
        while (!mLoadAsync.isDone)
        {
            SetLoading(mLoadAsync.progress);
            yield return(new WaitForEndOfFrame());
        }

        if (mLoadAsync.isDone)
        {
            LuaSceneTool.CurrentSceneIndex = mTargetSceneIndex;
            SceneManager.UnloadSceneAsync(1);
            SceneManager.SetActiveScene(SceneManager.GetSceneByBuildIndex(mTargetSceneIndex));
            LuaSceneTool.LoadSceneSuccess(mTargetSceneIndex);
            ClearData();
        }
        yield return(new WaitForEndOfFrame());
    }