475 lines
20 KiB
C#
475 lines
20 KiB
C#
#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 TMProMaterialReferenceWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(TMPro.MaterialReference);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 0, 9, 9);
|
|
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "index", _g_get_index);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "fontAsset", _g_get_fontAsset);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "spriteAsset", _g_get_spriteAsset);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "material", _g_get_material);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "isDefaultMaterial", _g_get_isDefaultMaterial);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "isFallbackMaterial", _g_get_isFallbackMaterial);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "fallbackMaterial", _g_get_fallbackMaterial);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "padding", _g_get_padding);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "referenceCount", _g_get_referenceCount);
|
|
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "index", _s_set_index);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "fontAsset", _s_set_fontAsset);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "spriteAsset", _s_set_spriteAsset);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "material", _s_set_material);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "isDefaultMaterial", _s_set_isDefaultMaterial);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "isFallbackMaterial", _s_set_isFallbackMaterial);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "fallbackMaterial", _s_set_fallbackMaterial);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "padding", _s_set_padding);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "referenceCount", _s_set_referenceCount);
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
|
null, null, null);
|
|
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 3, 0, 0);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "Contains", _m_Contains_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "AddMaterialReference", _m_AddMaterialReference_xlua_st_);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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) == 6 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable<TMPro.TMP_FontAsset>(L, 3) && translator.Assignable<TMPro.TMP_SpriteAsset>(L, 4) && translator.Assignable<UnityEngine.Material>(L, 5) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 6))
|
|
{
|
|
int _index = LuaAPI.xlua_tointeger(L, 2);
|
|
TMPro.TMP_FontAsset _fontAsset = (TMPro.TMP_FontAsset)translator.GetObject(L, 3, typeof(TMPro.TMP_FontAsset));
|
|
TMPro.TMP_SpriteAsset _spriteAsset = (TMPro.TMP_SpriteAsset)translator.GetObject(L, 4, typeof(TMPro.TMP_SpriteAsset));
|
|
UnityEngine.Material _material = (UnityEngine.Material)translator.GetObject(L, 5, typeof(UnityEngine.Material));
|
|
float _padding = (float)LuaAPI.lua_tonumber(L, 6);
|
|
|
|
var gen_ret = new TMPro.MaterialReference(_index, _fontAsset, _spriteAsset, _material, _padding);
|
|
translator.Push(L, gen_ret);
|
|
|
|
return 1;
|
|
}
|
|
|
|
if (LuaAPI.lua_gettop(L) == 1)
|
|
{
|
|
translator.Push(L, default(TMPro.MaterialReference));
|
|
return 1;
|
|
}
|
|
|
|
}
|
|
catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to TMPro.MaterialReference constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_Contains_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
TMPro.MaterialReference[] _materialReferences = (TMPro.MaterialReference[])translator.GetObject(L, 1, typeof(TMPro.MaterialReference[]));
|
|
TMPro.TMP_FontAsset _fontAsset = (TMPro.TMP_FontAsset)translator.GetObject(L, 2, typeof(TMPro.TMP_FontAsset));
|
|
|
|
var gen_ret = TMPro.MaterialReference.Contains( _materialReferences, _fontAsset );
|
|
LuaAPI.lua_pushboolean(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_AddMaterialReference_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
|
|
if(gen_param_count == 4&& translator.Assignable<UnityEngine.Material>(L, 1)&& translator.Assignable<TMPro.TMP_FontAsset>(L, 2)&& translator.Assignable<TMPro.MaterialReference[]>(L, 3)&& translator.Assignable<System.Collections.Generic.Dictionary<int, int>>(L, 4))
|
|
{
|
|
UnityEngine.Material _material = (UnityEngine.Material)translator.GetObject(L, 1, typeof(UnityEngine.Material));
|
|
TMPro.TMP_FontAsset _fontAsset = (TMPro.TMP_FontAsset)translator.GetObject(L, 2, typeof(TMPro.TMP_FontAsset));
|
|
TMPro.MaterialReference[] _materialReferences = (TMPro.MaterialReference[])translator.GetObject(L, 3, typeof(TMPro.MaterialReference[]));
|
|
System.Collections.Generic.Dictionary<int, int> _materialReferenceIndexLookup = (System.Collections.Generic.Dictionary<int, int>)translator.GetObject(L, 4, typeof(System.Collections.Generic.Dictionary<int, int>));
|
|
|
|
var gen_ret = TMPro.MaterialReference.AddMaterialReference( _material, _fontAsset, ref _materialReferences, _materialReferenceIndexLookup );
|
|
LuaAPI.xlua_pushinteger(L, gen_ret);
|
|
translator.Push(L, _materialReferences);
|
|
|
|
|
|
|
|
|
|
return 2;
|
|
}
|
|
if(gen_param_count == 4&& translator.Assignable<UnityEngine.Material>(L, 1)&& translator.Assignable<TMPro.TMP_SpriteAsset>(L, 2)&& translator.Assignable<TMPro.MaterialReference[]>(L, 3)&& translator.Assignable<System.Collections.Generic.Dictionary<int, int>>(L, 4))
|
|
{
|
|
UnityEngine.Material _material = (UnityEngine.Material)translator.GetObject(L, 1, typeof(UnityEngine.Material));
|
|
TMPro.TMP_SpriteAsset _spriteAsset = (TMPro.TMP_SpriteAsset)translator.GetObject(L, 2, typeof(TMPro.TMP_SpriteAsset));
|
|
TMPro.MaterialReference[] _materialReferences = (TMPro.MaterialReference[])translator.GetObject(L, 3, typeof(TMPro.MaterialReference[]));
|
|
System.Collections.Generic.Dictionary<int, int> _materialReferenceIndexLookup = (System.Collections.Generic.Dictionary<int, int>)translator.GetObject(L, 4, typeof(System.Collections.Generic.Dictionary<int, int>));
|
|
|
|
var gen_ret = TMPro.MaterialReference.AddMaterialReference( _material, _spriteAsset, ref _materialReferences, _materialReferenceIndexLookup );
|
|
LuaAPI.xlua_pushinteger(L, gen_ret);
|
|
translator.Push(L, _materialReferences);
|
|
|
|
|
|
|
|
|
|
return 2;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
return LuaAPI.luaL_error(L, "invalid arguments to TMPro.MaterialReference.AddMaterialReference!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_index(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.MaterialReference gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.index);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_fontAsset(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.MaterialReference gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
translator.Push(L, gen_to_be_invoked.fontAsset);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_spriteAsset(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.MaterialReference gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
translator.Push(L, gen_to_be_invoked.spriteAsset);
|
|
} 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.MaterialReference gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
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_isDefaultMaterial(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.MaterialReference gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
LuaAPI.lua_pushboolean(L, gen_to_be_invoked.isDefaultMaterial);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_isFallbackMaterial(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.MaterialReference gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
LuaAPI.lua_pushboolean(L, gen_to_be_invoked.isFallbackMaterial);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_fallbackMaterial(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.MaterialReference gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
translator.Push(L, gen_to_be_invoked.fallbackMaterial);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_padding(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.MaterialReference gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
LuaAPI.lua_pushnumber(L, gen_to_be_invoked.padding);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_referenceCount(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.MaterialReference gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.referenceCount);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_index(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.MaterialReference gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
gen_to_be_invoked.index = LuaAPI.xlua_tointeger(L, 2);
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_fontAsset(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.MaterialReference gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
gen_to_be_invoked.fontAsset = (TMPro.TMP_FontAsset)translator.GetObject(L, 2, typeof(TMPro.TMP_FontAsset));
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_spriteAsset(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.MaterialReference gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
gen_to_be_invoked.spriteAsset = (TMPro.TMP_SpriteAsset)translator.GetObject(L, 2, typeof(TMPro.TMP_SpriteAsset));
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
} 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.MaterialReference gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
gen_to_be_invoked.material = (UnityEngine.Material)translator.GetObject(L, 2, typeof(UnityEngine.Material));
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_isDefaultMaterial(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.MaterialReference gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
gen_to_be_invoked.isDefaultMaterial = LuaAPI.lua_toboolean(L, 2);
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_isFallbackMaterial(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.MaterialReference gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
gen_to_be_invoked.isFallbackMaterial = LuaAPI.lua_toboolean(L, 2);
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_fallbackMaterial(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.MaterialReference gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
gen_to_be_invoked.fallbackMaterial = (UnityEngine.Material)translator.GetObject(L, 2, typeof(UnityEngine.Material));
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_padding(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.MaterialReference gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
gen_to_be_invoked.padding = (float)LuaAPI.lua_tonumber(L, 2);
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_referenceCount(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.MaterialReference gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
gen_to_be_invoked.referenceCount = LuaAPI.xlua_tointeger(L, 2);
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|