271 lines
9.9 KiB
C#
271 lines
9.9 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 UnityEngineSurfaceEffector2DWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(UnityEngine.SurfaceEffector2D);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 0, 6, 6);
|
|
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "speed", _g_get_speed);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "speedVariation", _g_get_speedVariation);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "forceScale", _g_get_forceScale);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "useContactForce", _g_get_useContactForce);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "useFriction", _g_get_useFriction);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "useBounce", _g_get_useBounce);
|
|
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "speed", _s_set_speed);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "speedVariation", _s_set_speedVariation);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "forceScale", _s_set_forceScale);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "useContactForce", _s_set_useContactForce);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "useFriction", _s_set_useFriction);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "useBounce", _s_set_useBounce);
|
|
|
|
|
|
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) == 1)
|
|
{
|
|
|
|
var gen_ret = new UnityEngine.SurfaceEffector2D();
|
|
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 UnityEngine.SurfaceEffector2D constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_speed(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.SurfaceEffector2D gen_to_be_invoked = (UnityEngine.SurfaceEffector2D)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushnumber(L, gen_to_be_invoked.speed);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_speedVariation(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.SurfaceEffector2D gen_to_be_invoked = (UnityEngine.SurfaceEffector2D)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushnumber(L, gen_to_be_invoked.speedVariation);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_forceScale(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.SurfaceEffector2D gen_to_be_invoked = (UnityEngine.SurfaceEffector2D)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushnumber(L, gen_to_be_invoked.forceScale);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_useContactForce(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.SurfaceEffector2D gen_to_be_invoked = (UnityEngine.SurfaceEffector2D)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushboolean(L, gen_to_be_invoked.useContactForce);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_useFriction(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.SurfaceEffector2D gen_to_be_invoked = (UnityEngine.SurfaceEffector2D)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushboolean(L, gen_to_be_invoked.useFriction);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_useBounce(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.SurfaceEffector2D gen_to_be_invoked = (UnityEngine.SurfaceEffector2D)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushboolean(L, gen_to_be_invoked.useBounce);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_speed(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.SurfaceEffector2D gen_to_be_invoked = (UnityEngine.SurfaceEffector2D)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.speed = (float)LuaAPI.lua_tonumber(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_speedVariation(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.SurfaceEffector2D gen_to_be_invoked = (UnityEngine.SurfaceEffector2D)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.speedVariation = (float)LuaAPI.lua_tonumber(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_forceScale(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.SurfaceEffector2D gen_to_be_invoked = (UnityEngine.SurfaceEffector2D)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.forceScale = (float)LuaAPI.lua_tonumber(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_useContactForce(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.SurfaceEffector2D gen_to_be_invoked = (UnityEngine.SurfaceEffector2D)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.useContactForce = LuaAPI.lua_toboolean(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_useFriction(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.SurfaceEffector2D gen_to_be_invoked = (UnityEngine.SurfaceEffector2D)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.useFriction = LuaAPI.lua_toboolean(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_useBounce(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.SurfaceEffector2D gen_to_be_invoked = (UnityEngine.SurfaceEffector2D)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.useBounce = LuaAPI.lua_toboolean(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|