Ejemplo n.º 1
0
 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); });
     }
 }
Ejemplo n.º 2
0
 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));
     }
 }
Ejemplo n.º 3
0
 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));
     }
 }
Ejemplo n.º 4
0
    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"));
        }
    }
Ejemplo n.º 5
0
    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"));
        }
    }
Ejemplo n.º 6
0
    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));
        }
    }
Ejemplo n.º 7
0
 private void Awake()
 {
     instance = this;
     buttons  = FindObjectOfType <ButtonHandler>();
     portrait = FindObjectOfType <PortraitHandler>();
 }