#if USE_UNI_LUA using LuaAPI = UniLua.Lua; using RealStatePtr = UniLua.ILuaState; using LuaCSFunction = UniLua.CSharpFunctionDelegate; #else using LuaAPI = XLua.LuaDLL.Lua; using RealStatePtr = System.IntPtr; using LuaCSFunction = XLua.LuaDLL.lua_CSFunction; #endif using XLua; using System.Collections.Generic; namespace XLua.CSObjectWrap { using Utils = XLua.Utils; public class DebugExWrap { public static void __Register(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); System.Type type = typeof(DebugEx); Utils.BeginObjectRegister(type, L, translator, 0, 0, 0, 0); Utils.EndObjectRegister(type, L, translator, null, null, null, null, null); Utils.BeginClassRegister(type, L, __CreateInstance, 9, 4, 4); Utils.RegisterFunc(L, Utils.CLS_IDX, "Log", _m_Log_xlua_st_); Utils.RegisterFunc(L, Utils.CLS_IDX, "LogFormat", _m_LogFormat_xlua_st_); Utils.RegisterFunc(L, Utils.CLS_IDX, "LogError", _m_LogError_xlua_st_); Utils.RegisterFunc(L, Utils.CLS_IDX, "LogErrorFormat", _m_LogErrorFormat_xlua_st_); Utils.RegisterFunc(L, Utils.CLS_IDX, "LogWarning", _m_LogWarning_xlua_st_); Utils.RegisterFunc(L, Utils.CLS_IDX, "LogWarningFormat", _m_LogWarningFormat_xlua_st_); Utils.RegisterFunc(L, Utils.CLS_IDX, "NetLog", _m_NetLog_xlua_st_); Utils.RegisterFunc(L, Utils.CLS_IDX, "NetLogFormat", _m_NetLogFormat_xlua_st_); Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "EnableLog", _g_get_EnableLog); Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "EnableLogWarning", _g_get_EnableLogWarning); Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "EnableLogError", _g_get_EnableLogError); Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "EnableNetLog", _g_get_EnableNetLog); Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "EnableLog", _s_set_EnableLog); Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "EnableLogWarning", _s_set_EnableLogWarning); Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "EnableLogError", _s_set_EnableLogError); Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "EnableNetLog", _s_set_EnableNetLog); Utils.EndClassRegister(type, L, translator); } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int __CreateInstance(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); if(LuaAPI.lua_gettop(L) == 1) { DebugEx gen_ret = new DebugEx(); translator.Push(L, gen_ret); return 1; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return LuaAPI.luaL_error(L, "invalid arguments to DebugEx constructor!"); } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_Log_xlua_st_(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); { object _message = translator.GetObject(L, 1, typeof(object)); DebugEx.Log( _message ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_LogFormat_xlua_st_(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); { string _message = LuaAPI.lua_tostring(L, 1); object[] __objs = translator.GetParams(L, 2); DebugEx.LogFormat( _message, __objs ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_LogError_xlua_st_(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); { object _message = translator.GetObject(L, 1, typeof(object)); DebugEx.LogError( _message ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_LogErrorFormat_xlua_st_(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); { string _message = LuaAPI.lua_tostring(L, 1); object[] __objs = translator.GetParams(L, 2); DebugEx.LogErrorFormat( _message, __objs ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_LogWarning_xlua_st_(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); { object _message = translator.GetObject(L, 1, typeof(object)); DebugEx.LogWarning( _message ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_LogWarningFormat_xlua_st_(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); { string _message = LuaAPI.lua_tostring(L, 1); object[] __objs = translator.GetParams(L, 2); DebugEx.LogWarningFormat( _message, __objs ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_NetLog_xlua_st_(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); { object _message = translator.GetObject(L, 1, typeof(object)); DebugEx.NetLog( _message ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _m_NetLogFormat_xlua_st_(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); { string _message = LuaAPI.lua_tostring(L, 1); object[] __objs = translator.GetParams(L, 2); DebugEx.NetLogFormat( _message, __objs ); return 0; } } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_EnableLog(RealStatePtr L) { try { LuaAPI.lua_pushboolean(L, DebugEx.EnableLog); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_EnableLogWarning(RealStatePtr L) { try { LuaAPI.lua_pushboolean(L, DebugEx.EnableLogWarning); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_EnableLogError(RealStatePtr L) { try { LuaAPI.lua_pushboolean(L, DebugEx.EnableLogError); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_EnableNetLog(RealStatePtr L) { try { LuaAPI.lua_pushboolean(L, DebugEx.EnableNetLog); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_EnableLog(RealStatePtr L) { try { DebugEx.EnableLog = LuaAPI.lua_toboolean(L, 1); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_EnableLogWarning(RealStatePtr L) { try { DebugEx.EnableLogWarning = LuaAPI.lua_toboolean(L, 1); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_EnableLogError(RealStatePtr L) { try { DebugEx.EnableLogError = LuaAPI.lua_toboolean(L, 1); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_EnableNetLog(RealStatePtr L) { try { DebugEx.EnableNetLog = LuaAPI.lua_toboolean(L, 1); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } } }