148 lines
3.3 KiB
C#
148 lines
3.3 KiB
C#
//this source code was auto-generated by tolua#, do not modify it
|
|
using System;
|
|
using LuaInterface;
|
|
|
|
public class RolePropertyWrap
|
|
{
|
|
public static void Register(LuaState L)
|
|
{
|
|
L.BeginClass(typeof(RoleProperty), typeof(UnityEngine.MonoBehaviour));
|
|
L.RegFunction("AddProperty", AddProperty);
|
|
L.RegFunction("SetValue", SetValue);
|
|
L.RegFunction("GetValue", GetValue);
|
|
L.RegFunction("GetNames", GetNames);
|
|
L.RegFunction("__eq", op_Equality);
|
|
L.RegFunction("__tostring", ToLua.op_ToString);
|
|
L.RegVar("uid", get_uid, set_uid);
|
|
L.EndClass();
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int AddProperty(IntPtr L)
|
|
{
|
|
try
|
|
{
|
|
ToLua.CheckArgsCount(L, 3);
|
|
RoleProperty obj = (RoleProperty)ToLua.CheckObject<RoleProperty>(L, 1);
|
|
int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
|
|
float arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
|
|
obj.AddProperty(arg0, arg1);
|
|
return 0;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
}
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int SetValue(IntPtr L)
|
|
{
|
|
try
|
|
{
|
|
ToLua.CheckArgsCount(L, 3);
|
|
RoleProperty obj = (RoleProperty)ToLua.CheckObject<RoleProperty>(L, 1);
|
|
int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
|
|
float arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
|
|
obj.SetValue(arg0, arg1);
|
|
return 0;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
}
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int GetValue(IntPtr L)
|
|
{
|
|
try
|
|
{
|
|
ToLua.CheckArgsCount(L, 2);
|
|
RoleProperty obj = (RoleProperty)ToLua.CheckObject<RoleProperty>(L, 1);
|
|
string arg0 = ToLua.CheckString(L, 2);
|
|
float o = obj.GetValue(arg0);
|
|
LuaDLL.lua_pushnumber(L, o);
|
|
return 1;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
}
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int GetNames(IntPtr L)
|
|
{
|
|
try
|
|
{
|
|
ToLua.CheckArgsCount(L, 1);
|
|
RoleProperty obj = (RoleProperty)ToLua.CheckObject<RoleProperty>(L, 1);
|
|
string[] o = obj.GetNames();
|
|
ToLua.Push(L, o);
|
|
return 1;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
}
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int op_Equality(IntPtr L)
|
|
{
|
|
try
|
|
{
|
|
ToLua.CheckArgsCount(L, 2);
|
|
UnityEngine.Object arg0 = (UnityEngine.Object)ToLua.ToObject(L, 1);
|
|
UnityEngine.Object arg1 = (UnityEngine.Object)ToLua.ToObject(L, 2);
|
|
bool o = arg0 == arg1;
|
|
LuaDLL.lua_pushboolean(L, o);
|
|
return 1;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
return LuaDLL.toluaL_exception(L, e);
|
|
}
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int get_uid(IntPtr L)
|
|
{
|
|
object o = null;
|
|
|
|
try
|
|
{
|
|
o = ToLua.ToObject(L, 1);
|
|
RoleProperty obj = (RoleProperty)o;
|
|
int ret = obj.uid;
|
|
LuaDLL.lua_pushinteger(L, ret);
|
|
return 1;
|
|
}
|
|
catch(Exception e)
|
|
{
|
|
return LuaDLL.toluaL_exception(L, e, o, "attempt to index uid on a nil value");
|
|
}
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int set_uid(IntPtr L)
|
|
{
|
|
object o = null;
|
|
|
|
try
|
|
{
|
|
o = ToLua.ToObject(L, 1);
|
|
RoleProperty obj = (RoleProperty)o;
|
|
int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
|
|
obj.uid = arg0;
|
|
return 0;
|
|
}
|
|
catch(Exception e)
|
|
{
|
|
return LuaDLL.toluaL_exception(L, e, o, "attempt to index uid on a nil value");
|
|
}
|
|
}
|
|
}
|
|
|