989 lines
34 KiB
C#
989 lines
34 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 UnityEngineVector3IntWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(UnityEngine.Vector3Int);
|
|
Utils.BeginObjectRegister(type, L, translator, 6, 6, 5, 3);
|
|
Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__add", __AddMeta);
|
|
Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__sub", __SubMeta);
|
|
Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__mul", __MulMeta);
|
|
Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__unm", __UnmMeta);
|
|
Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__div", __DivMeta);
|
|
Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__eq", __EqMeta);
|
|
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Set", _m_Set);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Scale", _m_Scale);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Clamp", _m_Clamp);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Equals", _m_Equals);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetHashCode", _m_GetHashCode);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "ToString", _m_ToString);
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "x", _g_get_x);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "y", _g_get_y);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "z", _g_get_z);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "magnitude", _g_get_magnitude);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "sqrMagnitude", _g_get_sqrMagnitude);
|
|
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "x", _s_set_x);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "y", _s_set_y);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "z", _s_set_z);
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, __CSIndexer, __NewIndexer,
|
|
null, null, null);
|
|
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 8, 8, 0);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "Distance", _m_Distance_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "Min", _m_Min_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "Max", _m_Max_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "Scale", _m_Scale_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "FloorToInt", _m_FloorToInt_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "CeilToInt", _m_CeilToInt_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "RoundToInt", _m_RoundToInt_xlua_st_);
|
|
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "zero", _g_get_zero);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "one", _g_get_one);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "up", _g_get_up);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "down", _g_get_down);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "left", _g_get_left);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "right", _g_get_right);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "forward", _g_get_forward);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "back", _g_get_back);
|
|
|
|
|
|
|
|
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) == 4 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4))
|
|
{
|
|
int _x = LuaAPI.xlua_tointeger(L, 2);
|
|
int _y = LuaAPI.xlua_tointeger(L, 3);
|
|
int _z = LuaAPI.xlua_tointeger(L, 4);
|
|
|
|
var gen_ret = new UnityEngine.Vector3Int(_x, _y, _z);
|
|
translator.Push(L, gen_ret);
|
|
|
|
return 1;
|
|
}
|
|
|
|
if (LuaAPI.lua_gettop(L) == 1)
|
|
{
|
|
translator.Push(L, default(UnityEngine.Vector3Int));
|
|
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.Vector3Int constructor!");
|
|
|
|
}
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
public static int __CSIndexer(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
if (translator.Assignable<UnityEngine.Vector3Int>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
|
|
{
|
|
|
|
UnityEngine.Vector3Int gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
int index = LuaAPI.xlua_tointeger(L, 2);
|
|
LuaAPI.lua_pushboolean(L, true);
|
|
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked[index]);
|
|
return 2;
|
|
}
|
|
|
|
}
|
|
catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
LuaAPI.lua_pushboolean(L, false);
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
public static int __NewIndexer(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
try {
|
|
|
|
if (translator.Assignable<UnityEngine.Vector3Int>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3))
|
|
{
|
|
|
|
UnityEngine.Vector3Int gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
int key = LuaAPI.xlua_tointeger(L, 2);
|
|
gen_to_be_invoked[key] = LuaAPI.xlua_tointeger(L, 3);
|
|
LuaAPI.lua_pushboolean(L, true);
|
|
return 1;
|
|
}
|
|
|
|
}
|
|
catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
LuaAPI.lua_pushboolean(L, false);
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int __AddMeta(RealStatePtr L)
|
|
{
|
|
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
if (translator.Assignable<UnityEngine.Vector3Int>(L, 1) && translator.Assignable<UnityEngine.Vector3Int>(L, 2))
|
|
{
|
|
UnityEngine.Vector3Int leftside;translator.Get(L, 1, out leftside);
|
|
UnityEngine.Vector3Int rightside;translator.Get(L, 2, out rightside);
|
|
|
|
translator.Push(L, leftside + rightside);
|
|
|
|
return 1;
|
|
}
|
|
|
|
}
|
|
catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to right hand of + operator, need UnityEngine.Vector3Int!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int __SubMeta(RealStatePtr L)
|
|
{
|
|
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
if (translator.Assignable<UnityEngine.Vector3Int>(L, 1) && translator.Assignable<UnityEngine.Vector3Int>(L, 2))
|
|
{
|
|
UnityEngine.Vector3Int leftside;translator.Get(L, 1, out leftside);
|
|
UnityEngine.Vector3Int rightside;translator.Get(L, 2, out rightside);
|
|
|
|
translator.Push(L, leftside - rightside);
|
|
|
|
return 1;
|
|
}
|
|
|
|
}
|
|
catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to right hand of - operator, need UnityEngine.Vector3Int!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int __MulMeta(RealStatePtr L)
|
|
{
|
|
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
if (translator.Assignable<UnityEngine.Vector3Int>(L, 1) && translator.Assignable<UnityEngine.Vector3Int>(L, 2))
|
|
{
|
|
UnityEngine.Vector3Int leftside;translator.Get(L, 1, out leftside);
|
|
UnityEngine.Vector3Int rightside;translator.Get(L, 2, out rightside);
|
|
|
|
translator.Push(L, leftside * rightside);
|
|
|
|
return 1;
|
|
}
|
|
|
|
|
|
if (translator.Assignable<UnityEngine.Vector3Int>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
|
|
{
|
|
UnityEngine.Vector3Int leftside;translator.Get(L, 1, out leftside);
|
|
int rightside = LuaAPI.xlua_tointeger(L, 2);
|
|
|
|
translator.Push(L, leftside * rightside);
|
|
|
|
return 1;
|
|
}
|
|
|
|
|
|
if (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) && translator.Assignable<UnityEngine.Vector3Int>(L, 2))
|
|
{
|
|
int leftside = LuaAPI.xlua_tointeger(L, 1);
|
|
UnityEngine.Vector3Int rightside;translator.Get(L, 2, out rightside);
|
|
|
|
translator.Push(L, leftside * rightside);
|
|
|
|
return 1;
|
|
}
|
|
|
|
}
|
|
catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to right hand of * operator, need UnityEngine.Vector3Int!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int __UnmMeta(RealStatePtr L)
|
|
{
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
try {
|
|
UnityEngine.Vector3Int rightside;translator.Get(L, 1, out rightside);
|
|
translator.Push(L, - rightside);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int __DivMeta(RealStatePtr L)
|
|
{
|
|
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
if (translator.Assignable<UnityEngine.Vector3Int>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
|
|
{
|
|
UnityEngine.Vector3Int leftside;translator.Get(L, 1, out leftside);
|
|
int rightside = LuaAPI.xlua_tointeger(L, 2);
|
|
|
|
translator.Push(L, leftside / rightside);
|
|
|
|
return 1;
|
|
}
|
|
|
|
}
|
|
catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to right hand of / operator, need UnityEngine.Vector3Int!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int __EqMeta(RealStatePtr L)
|
|
{
|
|
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
if (translator.Assignable<UnityEngine.Vector3Int>(L, 1) && translator.Assignable<UnityEngine.Vector3Int>(L, 2))
|
|
{
|
|
UnityEngine.Vector3Int leftside;translator.Get(L, 1, out leftside);
|
|
UnityEngine.Vector3Int rightside;translator.Get(L, 2, out rightside);
|
|
|
|
LuaAPI.lua_pushboolean(L, leftside == rightside);
|
|
|
|
return 1;
|
|
}
|
|
|
|
}
|
|
catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return LuaAPI.luaL_error(L, "invalid arguments to right hand of == operator, need UnityEngine.Vector3Int!");
|
|
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_Set(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UnityEngine.Vector3Int gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
|
|
|
|
|
|
{
|
|
int _x = LuaAPI.xlua_tointeger(L, 2);
|
|
int _y = LuaAPI.xlua_tointeger(L, 3);
|
|
int _z = LuaAPI.xlua_tointeger(L, 4);
|
|
|
|
gen_to_be_invoked.Set( _x, _y, _z );
|
|
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_Distance_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Vector3Int _a;translator.Get(L, 1, out _a);
|
|
UnityEngine.Vector3Int _b;translator.Get(L, 2, out _b);
|
|
|
|
var gen_ret = UnityEngine.Vector3Int.Distance( _a, _b );
|
|
LuaAPI.lua_pushnumber(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_Min_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Vector3Int _lhs;translator.Get(L, 1, out _lhs);
|
|
UnityEngine.Vector3Int _rhs;translator.Get(L, 2, out _rhs);
|
|
|
|
var gen_ret = UnityEngine.Vector3Int.Min( _lhs, _rhs );
|
|
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_Max_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Vector3Int _lhs;translator.Get(L, 1, out _lhs);
|
|
UnityEngine.Vector3Int _rhs;translator.Get(L, 2, out _rhs);
|
|
|
|
var gen_ret = UnityEngine.Vector3Int.Max( _lhs, _rhs );
|
|
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_Scale_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Vector3Int _a;translator.Get(L, 1, out _a);
|
|
UnityEngine.Vector3Int _b;translator.Get(L, 2, out _b);
|
|
|
|
var gen_ret = UnityEngine.Vector3Int.Scale( _a, _b );
|
|
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_Scale(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UnityEngine.Vector3Int gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Vector3Int _scale;translator.Get(L, 2, out _scale);
|
|
|
|
gen_to_be_invoked.Scale( _scale );
|
|
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_Clamp(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UnityEngine.Vector3Int gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Vector3Int _min;translator.Get(L, 2, out _min);
|
|
UnityEngine.Vector3Int _max;translator.Get(L, 3, out _max);
|
|
|
|
gen_to_be_invoked.Clamp( _min, _max );
|
|
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_FloorToInt_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Vector3 _v;translator.Get(L, 1, out _v);
|
|
|
|
var gen_ret = UnityEngine.Vector3Int.FloorToInt( _v );
|
|
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_CeilToInt_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Vector3 _v;translator.Get(L, 1, out _v);
|
|
|
|
var gen_ret = UnityEngine.Vector3Int.CeilToInt( _v );
|
|
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_RoundToInt_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
UnityEngine.Vector3 _v;translator.Get(L, 1, out _v);
|
|
|
|
var gen_ret = UnityEngine.Vector3Int.RoundToInt( _v );
|
|
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_Equals(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UnityEngine.Vector3Int 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&& translator.Assignable<object>(L, 2))
|
|
{
|
|
object _other = translator.GetObject(L, 2, typeof(object));
|
|
|
|
var gen_ret = gen_to_be_invoked.Equals( _other );
|
|
LuaAPI.lua_pushboolean(L, gen_ret);
|
|
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 2&& translator.Assignable<UnityEngine.Vector3Int>(L, 2))
|
|
{
|
|
UnityEngine.Vector3Int _other;translator.Get(L, 2, out _other);
|
|
|
|
var gen_ret = gen_to_be_invoked.Equals( _other );
|
|
LuaAPI.lua_pushboolean(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.Vector3Int.Equals!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_GetHashCode(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UnityEngine.Vector3Int gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
|
|
|
|
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.GetHashCode( );
|
|
LuaAPI.xlua_pushinteger(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);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_ToString(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UnityEngine.Vector3Int 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 == 1)
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.ToString( );
|
|
LuaAPI.lua_pushstring(L, gen_ret);
|
|
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
|
|
{
|
|
string _format = LuaAPI.lua_tostring(L, 2);
|
|
|
|
var gen_ret = gen_to_be_invoked.ToString( _format );
|
|
LuaAPI.lua_pushstring(L, gen_ret);
|
|
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& translator.Assignable<System.IFormatProvider>(L, 3))
|
|
{
|
|
string _format = LuaAPI.lua_tostring(L, 2);
|
|
System.IFormatProvider _formatProvider = (System.IFormatProvider)translator.GetObject(L, 3, typeof(System.IFormatProvider));
|
|
|
|
var gen_ret = gen_to_be_invoked.ToString( _format, _formatProvider );
|
|
LuaAPI.lua_pushstring(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.Vector3Int.ToString!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_x(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.Vector3Int gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.x);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_y(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.Vector3Int gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.y);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_z(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.Vector3Int gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.z);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_magnitude(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.Vector3Int gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
LuaAPI.lua_pushnumber(L, gen_to_be_invoked.magnitude);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_sqrMagnitude(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.Vector3Int gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.sqrMagnitude);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_zero(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
translator.Push(L, UnityEngine.Vector3Int.zero);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_one(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
translator.Push(L, UnityEngine.Vector3Int.one);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_up(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
translator.Push(L, UnityEngine.Vector3Int.up);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_down(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
translator.Push(L, UnityEngine.Vector3Int.down);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_left(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
translator.Push(L, UnityEngine.Vector3Int.left);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_right(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
translator.Push(L, UnityEngine.Vector3Int.right);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_forward(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
translator.Push(L, UnityEngine.Vector3Int.forward);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_back(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
translator.Push(L, UnityEngine.Vector3Int.back);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_x(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.Vector3Int gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
gen_to_be_invoked.x = LuaAPI.xlua_tointeger(L, 2);
|
|
|
|
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_y(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.Vector3Int gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
gen_to_be_invoked.y = LuaAPI.xlua_tointeger(L, 2);
|
|
|
|
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_z(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.Vector3Int gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
|
|
gen_to_be_invoked.z = LuaAPI.xlua_tointeger(L, 2);
|
|
|
|
translator.Update(L, 1, gen_to_be_invoked);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|