public static void RegisterCommand(string commandName, string notificationName) { if (!HasCommand(notificationName)) { var cmd = new LuaCommand(commandName); commandMap.Add(notificationName, cmd); facade.RegisterCommand(notificationName, () => { return(cmd); }); } }
static int OnRemove(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); LuaCommand obj = (LuaCommand)ToLua.CheckObject <LuaCommand>(L, 1); obj.OnRemove(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int Execute(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); LuaCommand obj = (LuaCommand)ToLua.CheckObject <LuaCommand>(L, 1); PureMVC.Interfaces.INotification arg0 = (PureMVC.Interfaces.INotification)ToLua.CheckObject <PureMVC.Interfaces.INotification>(L, 2); obj.Execute(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int get_CommandName(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); LuaCommand obj = (LuaCommand)o; string ret = obj.CommandName; LuaDLL.lua_pushstring(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index CommandName on a nil value")); } }
static int get_Command(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); LuaCommand obj = (LuaCommand)o; LuaInterface.LuaTable ret = obj.Command; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Command on a nil value")); } }
static int _CreateLuaCommand(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 1) { string arg0 = ToLua.CheckString(L, 1); LuaCommand obj = new LuaCommand(arg0); ToLua.PushObject(L, obj); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: LuaCommand.New")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private void Awake() { instance = this; buttons = FindObjectOfType <ButtonHandler>(); portrait = FindObjectOfType <PortraitHandler>(); }