406 lines
15 KiB
C#
406 lines
15 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 UnityEngineParticleSystemMinMaxGradientWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(UnityEngine.ParticleSystem.MinMaxGradient);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 1, 7, 7);
|
|
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Evaluate", _m_Evaluate);
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "mode", _g_get_mode);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "gradientMax", _g_get_gradientMax);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "gradientMin", _g_get_gradientMin);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "colorMax", _g_get_colorMax);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "colorMin", _g_get_colorMin);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "color", _g_get_color);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "gradient", _g_get_gradient);
|
|
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "mode", _s_set_mode);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "gradientMax", _s_set_gradientMax);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "gradientMin", _s_set_gradientMin);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "colorMax", _s_set_colorMax);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "colorMin", _s_set_colorMin);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "color", _s_set_color);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "gradient", _s_set_gradient);
|
|
|
|
|
|
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 UnityEngine.ParticleSystem.MinMaxGradient(_color);
|
|
translator.Push(L, gen_ret);
|
|
|
|
return 1;
|
|
}
|
|
if(LuaAPI.lua_gettop(L) == 2 && translator.Assignable<UnityEngine.Gradient>(L, 2))
|
|
{
|
|
UnityEngine.Gradient _gradient = (UnityEngine.Gradient)translator.GetObject(L, 2, typeof(UnityEngine.Gradient));
|
|
|
|
var gen_ret = new UnityEngine.ParticleSystem.MinMaxGradient(_gradient);
|
|
translator.Push(L, gen_ret);
|
|
|
|
return 1;
|
|
}
|
|
if(LuaAPI.lua_gettop(L) == 3 && translator.Assignable<UnityEngine.Color>(L, 2) && translator.Assignable<UnityEngine.Color>(L, 3))
|
|
{
|
|
UnityEngine.Color _min;translator.Get(L, 2, out _min);
|
|
UnityEngine.Color _max;translator.Get(L, 3, out _max);
|
|
|
|
var gen_ret = new UnityEngine.ParticleSystem.MinMaxGradient(_min, _max);
|
|
translator.Push(L, gen_ret);
|
|
|
|
return 1;
|
|
}
|
|
if(LuaAPI.lua_gettop(L) == 3 && translator.Assignable<UnityEngine.Gradient>(L, 2) && translator.Assignable<UnityEngine.Gradient>(L, 3))
|
|
{
|
|
UnityEngine.Gradient _min = (UnityEngine.Gradient)translator.GetObject(L, 2, typeof(UnityEngine.Gradient));
|
|
UnityEngine.Gradient _max = (UnityEngine.Gradient)translator.GetObject(L, 3, typeof(UnityEngine.Gradient));
|
|
|
|
var gen_ret = new UnityEngine.ParticleSystem.MinMaxGradient(_min, _max);
|
|
translator.Push(L, gen_ret);
|
|
|
|
return 1;
|
|
}
|
|
|
|
if (LuaAPI.lua_gettop(L) == 1)
|
|
{
|
|
translator.Push(L, default(UnityEngine.ParticleSystem.MinMaxGradient));
|
|
return 1;
|
|
}
|
|
|
|
}
|
|
catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.ParticleSystem.MinMaxGradient constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_Evaluate(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UnityEngine.ParticleSystem.MinMaxGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
|
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
|
|
if(gen_param_count == 2&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
|
|
{
|
|
float _time = (float)LuaAPI.lua_tonumber(L, 2);
|
|
|
|
var gen_ret = gen_to_be_invoked.Evaluate( _time );
|
|
translator.PushUnityEngineColor(L, gen_ret);
|
|
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 3&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3))
|
|
{
|
|
float _time = (float)LuaAPI.lua_tonumber(L, 2);
|
|
float _lerpFactor = (float)LuaAPI.lua_tonumber(L, 3);
|
|
|
|
var gen_ret = gen_to_be_invoked.Evaluate( _time, _lerpFactor );
|
|
translator.PushUnityEngineColor(L, gen_ret);
|
|
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
|
|
return 1;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.ParticleSystem.MinMaxGradient.Evaluate!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_mode(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.ParticleSystem.MinMaxGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
translator.Push(L, gen_to_be_invoked.mode);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_gradientMax(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.ParticleSystem.MinMaxGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
translator.Push(L, gen_to_be_invoked.gradientMax);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_gradientMin(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.ParticleSystem.MinMaxGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
translator.Push(L, gen_to_be_invoked.gradientMin);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_colorMax(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.ParticleSystem.MinMaxGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
translator.PushUnityEngineColor(L, gen_to_be_invoked.colorMax);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_colorMin(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.ParticleSystem.MinMaxGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
translator.PushUnityEngineColor(L, gen_to_be_invoked.colorMin);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_color(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.ParticleSystem.MinMaxGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
translator.PushUnityEngineColor(L, gen_to_be_invoked.color);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_gradient(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.ParticleSystem.MinMaxGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
translator.Push(L, gen_to_be_invoked.gradient);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_mode(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.ParticleSystem.MinMaxGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
UnityEngine.ParticleSystemGradientMode gen_value;translator.Get(L, 2, out gen_value);
|
|
gen_to_be_invoked.mode = 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_gradientMax(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.ParticleSystem.MinMaxGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
gen_to_be_invoked.gradientMax = (UnityEngine.Gradient)translator.GetObject(L, 2, typeof(UnityEngine.Gradient));
|
|
|
|
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_gradientMin(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.ParticleSystem.MinMaxGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
gen_to_be_invoked.gradientMin = (UnityEngine.Gradient)translator.GetObject(L, 2, typeof(UnityEngine.Gradient));
|
|
|
|
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_colorMax(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.ParticleSystem.MinMaxGradient 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.colorMax = 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_colorMin(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.ParticleSystem.MinMaxGradient 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.colorMin = 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_color(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.ParticleSystem.MinMaxGradient 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.color = 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_gradient(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.ParticleSystem.MinMaxGradient gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
gen_to_be_invoked.gradient = (UnityEngine.Gradient)translator.GetObject(L, 2, typeof(UnityEngine.Gradient));
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|