Example #1
0
    public static int EnablePush(IntPtr L)
    {
        int       count = LuaDLL.lua_gettop(L);
        const int nRet  = 0;

        if (count == 2 && LuaScriptMgr.CheckTypes(L, 1, typeof(bool), typeof(int)))
        {
            bool enable = LuaScriptMgr.GetBoolean(L, 1);
            int  type   = (int)LuaScriptMgr.GetNumber(L, 2);
            PlatformControl.EnablePush(enable, type);
        }
        else if (count == 3 && LuaScriptMgr.CheckTypes(L, 1, typeof(bool), typeof(int), typeof(LuaFunction)))
        {
            bool enable   = LuaScriptMgr.GetBoolean(L, 1);
            int  type     = (int)LuaScriptMgr.GetNumber(L, 2);
            var  callback = LuaScriptMgr.GetLuaFunction(L, 3);
            PlatformControl.EnablePush(enable, type, callback);
        }
        else
        {
            LogParamError("EnablePush", count);
        }
        return(GameUtilWrap.CheckReturnNum(L, count, nRet));
    }