Beispiel #1
0
 static int CallFunction(IntPtr L)
 {
     try
     {
         int count             = LuaDLL.lua_gettop(L);
         Framework.LuaMgr obj  = (Framework.LuaMgr)ToLua.CheckObject <Framework.LuaMgr>(L, 1);
         string           arg0 = ToLua.CheckString(L, 2);
         object[]         arg1 = ToLua.ToParamsObject(L, 3, count - 2);
         object[]         o    = obj.CallFunction(arg0, arg1);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #2
0
    static int CallFunction(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("Framework.LuaMgr.CallFunction");
#endif
        try
        {
            int count             = LuaDLL.lua_gettop(L);
            Framework.LuaMgr obj  = (Framework.LuaMgr)ToLua.CheckObject <Framework.LuaMgr>(L, 1);
            string           arg0 = ToLua.CheckString(L, 2);
            object[]         arg1 = ToLua.ToParamsObject(L, 3, count - 2);
            object[]         o    = obj.CallFunction(arg0, arg1);
            ToLua.Push(L, o);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }