Ejemplo n.º 1
0
    static int LoadAsync(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 3);
            SceneLoadManager obj       = (SceneLoadManager)ToLua.CheckObject(L, 1, typeof(SceneLoadManager));
            string           arg0      = ToLua.CheckString(L, 2);
            Void_String      arg1      = null;
            LuaTypes         funcType3 = LuaDLL.lua_type(L, 3);

            if (funcType3 != LuaTypes.LUA_TFUNCTION)
            {
                arg1 = (Void_String)ToLua.CheckObject(L, 3, typeof(Void_String));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 3);
                arg1 = DelegateFactory.CreateDelegate(typeof(Void_String), func) as Void_String;
            }

            obj.LoadAsync(arg0, arg1);
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Ejemplo n.º 2
0
 public void LoadScene(string sceneName, Void_String callback)
 {
     SceneManager.LoadScene(sceneName);
     if (callback != null)
     {
         callback(sceneName);
     }
 }
Ejemplo n.º 3
0
    IEnumerator LoadAsync0(string sceneName, Void_String callback)
    {
        yield return(SceneManager.LoadSceneAsync(sceneName));

        if (callback != null)
        {
            callback(sceneName);
        }
    }
Ejemplo n.º 4
0
 public void LoadAsync(string sceneName, Void_String callback)
 {
     StartCoroutine(LoadAsync0(sceneName, callback));
 }