392 lines
13 KiB
C#
392 lines
13 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 TMProMaterialReferenceManagerWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(TMPro.MaterialReferenceManager);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 1, 0, 0);
|
|
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Contains", _m_Contains);
|
|
|
|
|
|
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
|
null, null, null);
|
|
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 9, 1, 0);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "AddFontAsset", _m_AddFontAsset_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "AddSpriteAsset", _m_AddSpriteAsset_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "AddFontMaterial", _m_AddFontMaterial_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "AddColorGradientPreset", _m_AddColorGradientPreset_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "TryGetFontAsset", _m_TryGetFontAsset_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "TryGetSpriteAsset", _m_TryGetSpriteAsset_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "TryGetColorGradientPreset", _m_TryGetColorGradientPreset_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "TryGetMaterial", _m_TryGetMaterial_xlua_st_);
|
|
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "instance", _g_get_instance);
|
|
|
|
|
|
|
|
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)
|
|
{
|
|
|
|
var gen_ret = new TMPro.MaterialReferenceManager();
|
|
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 TMPro.MaterialReferenceManager constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_AddFontAsset_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
TMPro.TMP_FontAsset _fontAsset = (TMPro.TMP_FontAsset)translator.GetObject(L, 1, typeof(TMPro.TMP_FontAsset));
|
|
|
|
TMPro.MaterialReferenceManager.AddFontAsset( _fontAsset );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_AddSpriteAsset_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
|
|
if(gen_param_count == 1&& translator.Assignable<TMPro.TMP_SpriteAsset>(L, 1))
|
|
{
|
|
TMPro.TMP_SpriteAsset _spriteAsset = (TMPro.TMP_SpriteAsset)translator.GetObject(L, 1, typeof(TMPro.TMP_SpriteAsset));
|
|
|
|
TMPro.MaterialReferenceManager.AddSpriteAsset( _spriteAsset );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
if(gen_param_count == 2&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1)&& translator.Assignable<TMPro.TMP_SpriteAsset>(L, 2))
|
|
{
|
|
int _hashCode = LuaAPI.xlua_tointeger(L, 1);
|
|
TMPro.TMP_SpriteAsset _spriteAsset = (TMPro.TMP_SpriteAsset)translator.GetObject(L, 2, typeof(TMPro.TMP_SpriteAsset));
|
|
|
|
TMPro.MaterialReferenceManager.AddSpriteAsset( _hashCode, _spriteAsset );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
return LuaAPI.luaL_error(L, "invalid arguments to TMPro.MaterialReferenceManager.AddSpriteAsset!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_AddFontMaterial_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
int _hashCode = LuaAPI.xlua_tointeger(L, 1);
|
|
UnityEngine.Material _material = (UnityEngine.Material)translator.GetObject(L, 2, typeof(UnityEngine.Material));
|
|
|
|
TMPro.MaterialReferenceManager.AddFontMaterial( _hashCode, _material );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_AddColorGradientPreset_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
int _hashCode = LuaAPI.xlua_tointeger(L, 1);
|
|
TMPro.TMP_ColorGradient _spriteAsset = (TMPro.TMP_ColorGradient)translator.GetObject(L, 2, typeof(TMPro.TMP_ColorGradient));
|
|
|
|
TMPro.MaterialReferenceManager.AddColorGradientPreset( _hashCode, _spriteAsset );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_Contains(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
TMPro.MaterialReferenceManager gen_to_be_invoked = (TMPro.MaterialReferenceManager)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
|
|
if(gen_param_count == 2&& translator.Assignable<TMPro.TMP_FontAsset>(L, 2))
|
|
{
|
|
TMPro.TMP_FontAsset _font = (TMPro.TMP_FontAsset)translator.GetObject(L, 2, typeof(TMPro.TMP_FontAsset));
|
|
|
|
var gen_ret = gen_to_be_invoked.Contains( _font );
|
|
LuaAPI.lua_pushboolean(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 2&& translator.Assignable<TMPro.TMP_SpriteAsset>(L, 2))
|
|
{
|
|
TMPro.TMP_SpriteAsset _sprite = (TMPro.TMP_SpriteAsset)translator.GetObject(L, 2, typeof(TMPro.TMP_SpriteAsset));
|
|
|
|
var gen_ret = gen_to_be_invoked.Contains( _sprite );
|
|
LuaAPI.lua_pushboolean(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 TMPro.MaterialReferenceManager.Contains!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_TryGetFontAsset_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
int _hashCode = LuaAPI.xlua_tointeger(L, 1);
|
|
TMPro.TMP_FontAsset _fontAsset;
|
|
|
|
var gen_ret = TMPro.MaterialReferenceManager.TryGetFontAsset( _hashCode, out _fontAsset );
|
|
LuaAPI.lua_pushboolean(L, gen_ret);
|
|
translator.Push(L, _fontAsset);
|
|
|
|
|
|
|
|
|
|
return 2;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_TryGetSpriteAsset_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
int _hashCode = LuaAPI.xlua_tointeger(L, 1);
|
|
TMPro.TMP_SpriteAsset _spriteAsset;
|
|
|
|
var gen_ret = TMPro.MaterialReferenceManager.TryGetSpriteAsset( _hashCode, out _spriteAsset );
|
|
LuaAPI.lua_pushboolean(L, gen_ret);
|
|
translator.Push(L, _spriteAsset);
|
|
|
|
|
|
|
|
|
|
return 2;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_TryGetColorGradientPreset_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
int _hashCode = LuaAPI.xlua_tointeger(L, 1);
|
|
TMPro.TMP_ColorGradient _gradientPreset;
|
|
|
|
var gen_ret = TMPro.MaterialReferenceManager.TryGetColorGradientPreset( _hashCode, out _gradientPreset );
|
|
LuaAPI.lua_pushboolean(L, gen_ret);
|
|
translator.Push(L, _gradientPreset);
|
|
|
|
|
|
|
|
|
|
return 2;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_TryGetMaterial_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
int _hashCode = LuaAPI.xlua_tointeger(L, 1);
|
|
UnityEngine.Material _material;
|
|
|
|
var gen_ret = TMPro.MaterialReferenceManager.TryGetMaterial( _hashCode, out _material );
|
|
LuaAPI.lua_pushboolean(L, gen_ret);
|
|
translator.Push(L, _material);
|
|
|
|
|
|
|
|
|
|
return 2;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_instance(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
translator.Push(L, TMPro.MaterialReferenceManager.instance);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|