580 lines
20 KiB
C#
580 lines
20 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 BFBattleControlBulletWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(BF.BattleControlBullet);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 12, 4, 4);
|
|
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetColliderEnabled", _m_SetColliderEnabled);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Recycle", _m_Recycle);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetupBoxCollisionBody", _m_SetupBoxCollisionBody);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetupSphereCollisionBody", _m_SetupSphereCollisionBody);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetAdmin", _m_SetAdmin);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "CachePosition", _m_CachePosition);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "CacheTargetPosition", _m_CacheTargetPosition);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "InitSphereBullet", _m_InitSphereBullet);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "InitBoxBullet", _m_InitBoxBullet);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetSearchTargetsCount", _m_GetSearchTargetsCount);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetTargetId", _m_GetTargetId);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "PlayTargetPointFx", _m_PlayTargetPointFx);
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "CacheX", _g_get_CacheX);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "CacheY", _g_get_CacheY);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "CacheZ", _g_get_CacheZ);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "IsRecycle", _g_get_IsRecycle);
|
|
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "CacheX", _s_set_CacheX);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "CacheY", _s_set_CacheY);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "CacheZ", _s_set_CacheZ);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "IsRecycle", _s_set_IsRecycle);
|
|
|
|
|
|
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 BF.BattleControlBullet();
|
|
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 BF.BattleControlBullet constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_SetColliderEnabled(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
bool _enabled = LuaAPI.lua_toboolean(L, 2);
|
|
|
|
gen_to_be_invoked.SetColliderEnabled( _enabled );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_Recycle(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.Recycle( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_SetupBoxCollisionBody(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
float _collisionWidth = (float)LuaAPI.lua_tonumber(L, 2);
|
|
float _collisionHeight = (float)LuaAPI.lua_tonumber(L, 3);
|
|
|
|
gen_to_be_invoked.SetupBoxCollisionBody( _collisionWidth, _collisionHeight );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_SetupSphereCollisionBody(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
float _collisionRadius = (float)LuaAPI.lua_tonumber(L, 2);
|
|
|
|
gen_to_be_invoked.SetupSphereCollisionBody( _collisionRadius );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_SetAdmin(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
BF.BattleControlUnit _unit = (BF.BattleControlUnit)translator.GetObject(L, 2, typeof(BF.BattleControlUnit));
|
|
|
|
gen_to_be_invoked.SetAdmin( _unit );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_CachePosition(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.CachePosition( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_CacheTargetPosition(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.CacheTargetPosition( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_InitSphereBullet(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
int _skillId = LuaAPI.xlua_tointeger(L, 2);
|
|
int _cloneIndex = LuaAPI.xlua_tointeger(L, 3);
|
|
int _skillEffectIndex = LuaAPI.xlua_tointeger(L, 4);
|
|
int _bulletType = LuaAPI.xlua_tointeger(L, 5);
|
|
int _bulletFinishType = LuaAPI.xlua_tointeger(L, 6);
|
|
int _bulletOriginType = LuaAPI.xlua_tointeger(L, 7);
|
|
int _searchType = LuaAPI.xlua_tointeger(L, 8);
|
|
float _radius = (float)LuaAPI.lua_tonumber(L, 9);
|
|
float _duration = (float)LuaAPI.lua_tonumber(L, 10);
|
|
float _speed = (float)LuaAPI.lua_tonumber(L, 11);
|
|
float _offsetX = (float)LuaAPI.lua_tonumber(L, 12);
|
|
float _offsetZ = (float)LuaAPI.lua_tonumber(L, 13);
|
|
|
|
gen_to_be_invoked.InitSphereBullet( _skillId, _cloneIndex, _skillEffectIndex, _bulletType, _bulletFinishType, _bulletOriginType, _searchType, _radius, _duration, _speed, _offsetX, _offsetZ );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_InitBoxBullet(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
int _skillId = LuaAPI.xlua_tointeger(L, 2);
|
|
int _cloneIndex = LuaAPI.xlua_tointeger(L, 3);
|
|
int _skillEffectIndex = LuaAPI.xlua_tointeger(L, 4);
|
|
int _bulletType = LuaAPI.xlua_tointeger(L, 5);
|
|
int _bulletFinishType = LuaAPI.xlua_tointeger(L, 6);
|
|
int _bulletOriginType = LuaAPI.xlua_tointeger(L, 7);
|
|
int _searchType = LuaAPI.xlua_tointeger(L, 8);
|
|
float _w = (float)LuaAPI.lua_tonumber(L, 9);
|
|
float _h = (float)LuaAPI.lua_tonumber(L, 10);
|
|
float _duration = (float)LuaAPI.lua_tonumber(L, 11);
|
|
float _speed = (float)LuaAPI.lua_tonumber(L, 12);
|
|
float _offsetX = (float)LuaAPI.lua_tonumber(L, 13);
|
|
float _offsetZ = (float)LuaAPI.lua_tonumber(L, 14);
|
|
|
|
gen_to_be_invoked.InitBoxBullet( _skillId, _cloneIndex, _skillEffectIndex, _bulletType, _bulletFinishType, _bulletOriginType, _searchType, _w, _h, _duration, _speed, _offsetX, _offsetZ );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_GetSearchTargetsCount(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.GetSearchTargetsCount( );
|
|
LuaAPI.xlua_pushinteger(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_GetTargetId(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
int _index = LuaAPI.xlua_tointeger(L, 2);
|
|
|
|
var gen_ret = gen_to_be_invoked.GetTargetId( _index );
|
|
LuaAPI.xlua_pushinteger(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_PlayTargetPointFx(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
int _id = LuaAPI.xlua_tointeger(L, 2);
|
|
float _delay = (float)LuaAPI.lua_tonumber(L, 3);
|
|
|
|
gen_to_be_invoked.PlayTargetPointFx( _id, _delay );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_CacheX(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushnumber(L, gen_to_be_invoked.CacheX);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_CacheY(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushnumber(L, gen_to_be_invoked.CacheY);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_CacheZ(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushnumber(L, gen_to_be_invoked.CacheZ);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_IsRecycle(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushboolean(L, gen_to_be_invoked.IsRecycle);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_CacheX(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.CacheX = (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_CacheY(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.CacheY = (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_CacheZ(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.CacheZ = (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_IsRecycle(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BattleControlBullet gen_to_be_invoked = (BF.BattleControlBullet)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.IsRecycle = LuaAPI.lua_toboolean(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|