240 lines
8.2 KiB
C#
240 lines
8.2 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 TMProVertexGradientWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(TMPro.VertexGradient);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 0, 4, 4);
|
|
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "topLeft", _g_get_topLeft);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "topRight", _g_get_topRight);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "bottomLeft", _g_get_bottomLeft);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "bottomRight", _g_get_bottomRight);
|
|
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "topLeft", _s_set_topLeft);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "topRight", _s_set_topRight);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "bottomLeft", _s_set_bottomLeft);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "bottomRight", _s_set_bottomRight);
|
|
|
|
|
|
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)
|
|
{
|
|
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
if(LuaAPI.lua_gettop(L) == 2 && translator.Assignable<UnityEngine.Color>(L, 2))
|
|
{
|
|
UnityEngine.Color _color;translator.Get(L, 2, out _color);
|
|
|
|
var gen_ret = new TMPro.VertexGradient(_color);
|
|
translator.Push(L, gen_ret);
|
|
|
|
return 1;
|
|
}
|
|
if(LuaAPI.lua_gettop(L) == 5 && translator.Assignable<UnityEngine.Color>(L, 2) && translator.Assignable<UnityEngine.Color>(L, 3) && translator.Assignable<UnityEngine.Color>(L, 4) && translator.Assignable<UnityEngine.Color>(L, 5))
|
|
{
|
|
UnityEngine.Color _color0;translator.Get(L, 2, out _color0);
|
|
UnityEngine.Color _color1;translator.Get(L, 3, out _color1);
|
|
UnityEngine.Color _color2;translator.Get(L, 4, out _color2);
|
|
UnityEngine.Color _color3;translator.Get(L, 5, out _color3);
|
|
|
|
var gen_ret = new TMPro.VertexGradient(_color0, _color1, _color2, _color3);
|
|
translator.Push(L, gen_ret);
|
|
|
|
return 1;
|
|
}
|
|
|
|
if (LuaAPI.lua_gettop(L) == 1)
|
|
{
|
|
translator.Push(L, default(TMPro.VertexGradient));
|
|
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.VertexGradient constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_topLeft(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.VertexGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
translator.PushUnityEngineColor(L, gen_to_be_invoked.topLeft);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_topRight(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.VertexGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
translator.PushUnityEngineColor(L, gen_to_be_invoked.topRight);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_bottomLeft(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.VertexGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
translator.PushUnityEngineColor(L, gen_to_be_invoked.bottomLeft);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_bottomRight(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.VertexGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
translator.PushUnityEngineColor(L, gen_to_be_invoked.bottomRight);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_topLeft(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.VertexGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
UnityEngine.Color gen_value;translator.Get(L, 2, out gen_value);
|
|
gen_to_be_invoked.topLeft = gen_value;
|
|
|
|
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_topRight(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.VertexGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
UnityEngine.Color gen_value;translator.Get(L, 2, out gen_value);
|
|
gen_to_be_invoked.topRight = gen_value;
|
|
|
|
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_bottomLeft(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.VertexGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
UnityEngine.Color gen_value;translator.Get(L, 2, out gen_value);
|
|
gen_to_be_invoked.bottomLeft = gen_value;
|
|
|
|
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_bottomRight(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
TMPro.VertexGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
UnityEngine.Color gen_value;translator.Get(L, 2, out gen_value);
|
|
gen_to_be_invoked.bottomRight = gen_value;
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|