507 lines
17 KiB
C#
507 lines
17 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_MaterialManagerWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(TMPro.TMP_MaterialManager);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 0, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
|
null, null, null);
|
|
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 17, 0, 0);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "GetStencilMaterial", _m_GetStencilMaterial_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "ReleaseStencilMaterial", _m_ReleaseStencilMaterial_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "GetBaseMaterial", _m_GetBaseMaterial_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "SetStencil", _m_SetStencil_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "AddMaskingMaterial", _m_AddMaskingMaterial_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "RemoveStencilMaterial", _m_RemoveStencilMaterial_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "ReleaseBaseMaterial", _m_ReleaseBaseMaterial_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "ClearMaterials", _m_ClearMaterials_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "GetStencilID", _m_GetStencilID_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "GetMaterialForRendering", _m_GetMaterialForRendering_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "GetFallbackMaterial", _m_GetFallbackMaterial_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "AddFallbackMaterialReference", _m_AddFallbackMaterialReference_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "RemoveFallbackMaterialReference", _m_RemoveFallbackMaterialReference_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "CleanupFallbackMaterials", _m_CleanupFallbackMaterials_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "ReleaseFallbackMaterial", _m_ReleaseFallbackMaterial_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "CopyMaterialPresetProperties", _m_CopyMaterialPresetProperties_xlua_st_);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Utils.EndClassRegister(type, L, translator);
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int __CreateInstance(RealStatePtr L)
|
|
{
|
|
return LuaAPI.luaL_error(L, "TMPro.TMP_MaterialManager does not have a constructor!");
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_GetStencilMaterial_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Material _baseMaterial = (UnityEngine.Material)translator.GetObject(L, 1, typeof(UnityEngine.Material));
|
|
int _stencilID = LuaAPI.xlua_tointeger(L, 2);
|
|
|
|
var gen_ret = TMPro.TMP_MaterialManager.GetStencilMaterial( _baseMaterial, _stencilID );
|
|
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 _m_ReleaseStencilMaterial_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Material _stencilMaterial = (UnityEngine.Material)translator.GetObject(L, 1, typeof(UnityEngine.Material));
|
|
|
|
TMPro.TMP_MaterialManager.ReleaseStencilMaterial( _stencilMaterial );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_GetBaseMaterial_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Material _stencilMaterial = (UnityEngine.Material)translator.GetObject(L, 1, typeof(UnityEngine.Material));
|
|
|
|
var gen_ret = TMPro.TMP_MaterialManager.GetBaseMaterial( _stencilMaterial );
|
|
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 _m_SetStencil_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Material _material = (UnityEngine.Material)translator.GetObject(L, 1, typeof(UnityEngine.Material));
|
|
int _stencilID = LuaAPI.xlua_tointeger(L, 2);
|
|
|
|
var gen_ret = TMPro.TMP_MaterialManager.SetStencil( _material, _stencilID );
|
|
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 _m_AddMaskingMaterial_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Material _baseMaterial = (UnityEngine.Material)translator.GetObject(L, 1, typeof(UnityEngine.Material));
|
|
UnityEngine.Material _stencilMaterial = (UnityEngine.Material)translator.GetObject(L, 2, typeof(UnityEngine.Material));
|
|
int _stencilID = LuaAPI.xlua_tointeger(L, 3);
|
|
|
|
TMPro.TMP_MaterialManager.AddMaskingMaterial( _baseMaterial, _stencilMaterial, _stencilID );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_RemoveStencilMaterial_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Material _stencilMaterial = (UnityEngine.Material)translator.GetObject(L, 1, typeof(UnityEngine.Material));
|
|
|
|
TMPro.TMP_MaterialManager.RemoveStencilMaterial( _stencilMaterial );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_ReleaseBaseMaterial_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Material _baseMaterial = (UnityEngine.Material)translator.GetObject(L, 1, typeof(UnityEngine.Material));
|
|
|
|
TMPro.TMP_MaterialManager.ReleaseBaseMaterial( _baseMaterial );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_ClearMaterials_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
TMPro.TMP_MaterialManager.ClearMaterials( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_GetStencilID_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.GameObject _obj = (UnityEngine.GameObject)translator.GetObject(L, 1, typeof(UnityEngine.GameObject));
|
|
|
|
var gen_ret = TMPro.TMP_MaterialManager.GetStencilID( _obj );
|
|
LuaAPI.xlua_pushinteger(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_GetMaterialForRendering_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.UI.MaskableGraphic _graphic = (UnityEngine.UI.MaskableGraphic)translator.GetObject(L, 1, typeof(UnityEngine.UI.MaskableGraphic));
|
|
UnityEngine.Material _baseMaterial = (UnityEngine.Material)translator.GetObject(L, 2, typeof(UnityEngine.Material));
|
|
|
|
var gen_ret = TMPro.TMP_MaterialManager.GetMaterialForRendering( _graphic, _baseMaterial );
|
|
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 _m_GetFallbackMaterial_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Material _sourceMaterial = (UnityEngine.Material)translator.GetObject(L, 1, typeof(UnityEngine.Material));
|
|
UnityEngine.Material _targetMaterial = (UnityEngine.Material)translator.GetObject(L, 2, typeof(UnityEngine.Material));
|
|
|
|
var gen_ret = TMPro.TMP_MaterialManager.GetFallbackMaterial( _sourceMaterial, _targetMaterial );
|
|
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 _m_AddFallbackMaterialReference_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Material _targetMaterial = (UnityEngine.Material)translator.GetObject(L, 1, typeof(UnityEngine.Material));
|
|
|
|
TMPro.TMP_MaterialManager.AddFallbackMaterialReference( _targetMaterial );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_RemoveFallbackMaterialReference_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Material _targetMaterial = (UnityEngine.Material)translator.GetObject(L, 1, typeof(UnityEngine.Material));
|
|
|
|
TMPro.TMP_MaterialManager.RemoveFallbackMaterialReference( _targetMaterial );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_CleanupFallbackMaterials_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
TMPro.TMP_MaterialManager.CleanupFallbackMaterials( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_ReleaseFallbackMaterial_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Material _fallbackMaterial = (UnityEngine.Material)translator.GetObject(L, 1, typeof(UnityEngine.Material));
|
|
|
|
TMPro.TMP_MaterialManager.ReleaseFallbackMaterial( _fallbackMaterial );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_CopyMaterialPresetProperties_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Material _source = (UnityEngine.Material)translator.GetObject(L, 1, typeof(UnityEngine.Material));
|
|
UnityEngine.Material _destination = (UnityEngine.Material)translator.GetObject(L, 2, typeof(UnityEngine.Material));
|
|
|
|
TMPro.TMP_MaterialManager.CopyMaterialPresetProperties( _source, _destination );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|