#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 TMProTMP_AssetWrap { public static void __Register(RealStatePtr L) { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); System.Type type = typeof(TMPro.TMP_Asset); Utils.BeginObjectRegister(type, L, translator, 0, 0, 4, 3); Utils.RegisterFunc(L, Utils.GETTER_IDX, "instanceID", _g_get_instanceID); Utils.RegisterFunc(L, Utils.GETTER_IDX, "hashCode", _g_get_hashCode); Utils.RegisterFunc(L, Utils.GETTER_IDX, "material", _g_get_material); Utils.RegisterFunc(L, Utils.GETTER_IDX, "materialHashCode", _g_get_materialHashCode); Utils.RegisterFunc(L, Utils.SETTER_IDX, "hashCode", _s_set_hashCode); Utils.RegisterFunc(L, Utils.SETTER_IDX, "material", _s_set_material); Utils.RegisterFunc(L, Utils.SETTER_IDX, "materialHashCode", _s_set_materialHashCode); Utils.EndObjectRegister(type, L, translator, null, null, null, null, null); Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0); Utils.EndClassRegister(type, L, translator); } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int __CreateInstance(RealStatePtr L) { return LuaAPI.luaL_error(L, "TMPro.TMP_Asset does not have a constructor!"); } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_instanceID(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); TMPro.TMP_Asset gen_to_be_invoked = (TMPro.TMP_Asset)translator.FastGetCSObj(L, 1); LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.instanceID); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_hashCode(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); TMPro.TMP_Asset gen_to_be_invoked = (TMPro.TMP_Asset)translator.FastGetCSObj(L, 1); LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.hashCode); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_material(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); TMPro.TMP_Asset gen_to_be_invoked = (TMPro.TMP_Asset)translator.FastGetCSObj(L, 1); translator.Push(L, gen_to_be_invoked.material); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _g_get_materialHashCode(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); TMPro.TMP_Asset gen_to_be_invoked = (TMPro.TMP_Asset)translator.FastGetCSObj(L, 1); LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.materialHashCode); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 1; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_hashCode(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); TMPro.TMP_Asset gen_to_be_invoked = (TMPro.TMP_Asset)translator.FastGetCSObj(L, 1); gen_to_be_invoked.hashCode = LuaAPI.xlua_tointeger(L, 2); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_material(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); TMPro.TMP_Asset gen_to_be_invoked = (TMPro.TMP_Asset)translator.FastGetCSObj(L, 1); gen_to_be_invoked.material = (UnityEngine.Material)translator.GetObject(L, 2, typeof(UnityEngine.Material)); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int _s_set_materialHashCode(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); TMPro.TMP_Asset gen_to_be_invoked = (TMPro.TMP_Asset)translator.FastGetCSObj(L, 1); gen_to_be_invoked.materialHashCode = LuaAPI.xlua_tointeger(L, 2); } catch(System.Exception gen_e) { return LuaAPI.luaL_error(L, "c# exception:" + gen_e); } return 0; } } }