199 lines
6.8 KiB
C#
199 lines
6.8 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 TMProTMP_FontAssetUtilitiesWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(TMPro.TMP_FontAssetUtilities);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 0, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
|
null, null, null);
|
|
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 4, 1, 0);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "GetCharacterFromFontAsset", _m_GetCharacterFromFontAsset_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "GetCharacterFromFontAssets", _m_GetCharacterFromFontAssets_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "GetSpriteCharacterFromSpriteAsset", _m_GetSpriteCharacterFromSpriteAsset_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.TMP_FontAssetUtilities();
|
|
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.TMP_FontAssetUtilities constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_GetCharacterFromFontAsset_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
uint _unicode = LuaAPI.xlua_touint(L, 1);
|
|
TMPro.TMP_FontAsset _sourceFontAsset = (TMPro.TMP_FontAsset)translator.GetObject(L, 2, typeof(TMPro.TMP_FontAsset));
|
|
bool _includeFallbacks = LuaAPI.lua_toboolean(L, 3);
|
|
TMPro.FontStyles _fontStyle;translator.Get(L, 4, out _fontStyle);
|
|
TMPro.FontWeight _fontWeight;translator.Get(L, 5, out _fontWeight);
|
|
bool _isAlternativeTypeface;
|
|
|
|
var gen_ret = TMPro.TMP_FontAssetUtilities.GetCharacterFromFontAsset( _unicode, _sourceFontAsset, _includeFallbacks, _fontStyle, _fontWeight, out _isAlternativeTypeface );
|
|
translator.Push(L, gen_ret);
|
|
LuaAPI.lua_pushboolean(L, _isAlternativeTypeface);
|
|
|
|
|
|
|
|
|
|
return 2;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_GetCharacterFromFontAssets_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
uint _unicode = LuaAPI.xlua_touint(L, 1);
|
|
TMPro.TMP_FontAsset _sourceFontAsset = (TMPro.TMP_FontAsset)translator.GetObject(L, 2, typeof(TMPro.TMP_FontAsset));
|
|
System.Collections.Generic.List<TMPro.TMP_FontAsset> _fontAssets = (System.Collections.Generic.List<TMPro.TMP_FontAsset>)translator.GetObject(L, 3, typeof(System.Collections.Generic.List<TMPro.TMP_FontAsset>));
|
|
bool _includeFallbacks = LuaAPI.lua_toboolean(L, 4);
|
|
TMPro.FontStyles _fontStyle;translator.Get(L, 5, out _fontStyle);
|
|
TMPro.FontWeight _fontWeight;translator.Get(L, 6, out _fontWeight);
|
|
bool _isAlternativeTypeface;
|
|
|
|
var gen_ret = TMPro.TMP_FontAssetUtilities.GetCharacterFromFontAssets( _unicode, _sourceFontAsset, _fontAssets, _includeFallbacks, _fontStyle, _fontWeight, out _isAlternativeTypeface );
|
|
translator.Push(L, gen_ret);
|
|
LuaAPI.lua_pushboolean(L, _isAlternativeTypeface);
|
|
|
|
|
|
|
|
|
|
return 2;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_GetSpriteCharacterFromSpriteAsset_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
uint _unicode = LuaAPI.xlua_touint(L, 1);
|
|
TMPro.TMP_SpriteAsset _spriteAsset = (TMPro.TMP_SpriteAsset)translator.GetObject(L, 2, typeof(TMPro.TMP_SpriteAsset));
|
|
bool _includeFallbacks = LuaAPI.lua_toboolean(L, 3);
|
|
|
|
var gen_ret = TMPro.TMP_FontAssetUtilities.GetSpriteCharacterFromSpriteAsset( _unicode, _spriteAsset, _includeFallbacks );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
|
|
} 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.TMP_FontAssetUtilities.instance);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|