public static int RegisterCallback(IntPtr L) { int count = LuaDLL.lua_gettop(L); const int nRet = 0; if (count == 3 && LuaScriptMgr.CheckTypes(L, 1, typeof(LuaFunction), typeof(LuaFunction), typeof(LuaFunction))) { var fnLoginCallback = LuaScriptMgr.GetLuaFunction(L, 1); var fnLogoutCallback = LuaScriptMgr.GetLuaFunction(L, 2); var fnBuyCallback = LuaScriptMgr.GetLuaFunction(L, 3); PlatformControl.RegisterCallback(fnLoginCallback, fnLogoutCallback, fnBuyCallback); } else { LogParamError("RegisterCallback", count); } return(GameUtilWrap.CheckReturnNum(L, count, nRet)); }