static int RegisterProxy(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 1) { string arg0 = ToLua.CheckString(L, 1); LuaFacade.RegisterProxy(arg0); return(0); } else if (count == 2) { string arg0 = ToLua.CheckString(L, 1); object arg1 = ToLua.ToVarObject(L, 2); LuaFacade.RegisterProxy(arg0, arg1); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: LuaFacade.RegisterProxy")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int UpdateLocalProtos(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 0) { System.Collections.IEnumerator o = LuaFacade.UpdateLocalProtos(); ToLua.Push(L, o); return(1); } else if (count == 1) { bool arg0 = LuaDLL.luaL_checkboolean(L, 1); System.Collections.IEnumerator o = LuaFacade.UpdateLocalProtos(arg0); ToLua.Push(L, o); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: LuaFacade.UpdateLocalProtos")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int Initialize(IntPtr L) { try { ToLua.CheckArgsCount(L, 0); LuaFacade.Initialize(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private static IEnumerator InitializeAsync() { yield return(CoroutineManager.DoCoroutine(LuaFacade.UpdateLocalScripts())); yield return(CoroutineManager.DoCoroutine(LuaFacade.UpdateLocalProtos())); LuaFacade.Initialize(); AddressablesUpdater.RequestDownloadHandle = OnRequestDownload; AddressablesUpdater.OnDownload += OnDownload; AddressablesUpdater.AfterDownloadHandle = OnAfterDownload; AddressablesUpdater.OnCompleted += OnCompleted; new GameObject("AddressablesUpdater").AddComponent <AddressablesUpdater>(); }
static int RemoveProxy(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); string arg0 = ToLua.CheckString(L, 1); LuaFacade.RemoveProxy(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int HasProxy(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); string arg0 = ToLua.CheckString(L, 1); bool o = LuaFacade.HasProxy(arg0); LuaDLL.lua_pushboolean(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int RetrieveProxy(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); string arg0 = ToLua.CheckString(L, 1); LuaInterface.LuaTable o = LuaFacade.RetrieveProxy(arg0); ToLua.Push(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int RegisterCommand(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); string arg0 = ToLua.CheckString(L, 1); string arg1 = ToLua.CheckString(L, 2); LuaFacade.RegisterCommand(arg0, arg1); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private static void OnCompleted() { if (hotUpdateClass != null) { if (hotUpdateObject != null) { hotUpdateClass.Call("OnDestroy", hotUpdateObject); hotUpdateObject.Dispose(); hotUpdateObject = null; } hotUpdateClass.Dispose(); hotUpdateClass = null; GameObject.DestroyImmediate(LuaClient.Instance.gameObject); LuaFacade.Initialize(); } LuaFacade.SendNotification("StartUp"); }
private static IEnumerator OnRequestDownload(long downloadSize) { hotUpdateClass = LuaFacade.GetTable("HotUpdate"); hotUpdateObject = hotUpdateClass.Invoke <LuaTable>("new"); hotUpdateClass.Call("Initialize", hotUpdateObject, downloadSize); yield return(null); while (!hotUpdateClass.Invoke <LuaTable, bool>("Response", hotUpdateObject)) { yield return(null); } if (hotUpdateClass.Invoke <LuaTable, bool>("Result", hotUpdateObject)) { AddressablesUpdater.Result = RequestDownloadResult.Agree; } else { AddressablesUpdater.Result = RequestDownloadResult.Disagree; } }
static int SendNotification(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 1) { string arg0 = ToLua.CheckString(L, 1); LuaFacade.SendNotification(arg0); return(0); } else if (count == 2) { string arg0 = ToLua.CheckString(L, 1); LuaTable arg1 = ToLua.CheckLuaTable(L, 2); LuaFacade.SendNotification(arg0, arg1); return(0); } else if (count == 3) { string arg0 = ToLua.CheckString(L, 1); LuaTable arg1 = ToLua.CheckLuaTable(L, 2); string arg2 = ToLua.CheckString(L, 3); LuaFacade.SendNotification(arg0, arg1, arg2); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: LuaFacade.SendNotification")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public LuaCommand(string commandName) { CommandName = commandName; commandClass = LuaFacade.GetTable(commandName); commandObject = commandClass.Invoke <LuaTable>("new"); }
public LuaMediator(string mediatorName, object viewComponent = null) : base(mediatorName, viewComponent) { mediatorClass = LuaFacade.GetTable(mediatorName); mediatorObject = mediatorClass.Invoke <LuaTable>("new"); }
public LuaProxy(string proxyName, object data = null) : base(proxyName, data) { proxyClass = LuaFacade.GetTable(proxyName); proxyObject = proxyClass.Invoke <LuaTable>("new"); }
private static IEnumerator OnAfterDownload() { yield return(CoroutineManager.DoCoroutine(LuaFacade.UpdateLocalScripts(true))); yield return(CoroutineManager.DoCoroutine(LuaFacade.UpdateLocalProtos(true))); }