665 lines
20 KiB
C#
665 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 BFBattleControlMonsterWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(BF.BattleControlMonster);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 20, 0, 0);
|
|
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "InitMonster", _m_InitMonster);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "InitHpBar", _m_InitHpBar);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "RefreshHpBar", _m_RefreshHpBar);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "InitPosition", _m_InitPosition);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "EnterDisappear", _m_EnterDisappear);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "ExitDisappear", _m_ExitDisappear);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetTarget", _m_SetTarget);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetIsNormalMonster", _m_GetIsNormalMonster);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetIsBOSS", _m_GetIsBOSS);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "StopMove", _m_StopMove);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "StartMove", _m_StartMove);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "InstantKill", _m_InstantKill);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "PlayAirborne", _m_PlayAirborne);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "StopAirborne", _m_StopAirborne);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "MoveWithSkillAI", _m_MoveWithSkillAI);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "TowardToTarget", _m_TowardToTarget);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "ForceTowardToTarget", _m_ForceTowardToTarget);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "BeHitBack", _m_BeHitBack);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnDead", _m_OnDead);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Clear", _m_Clear);
|
|
|
|
|
|
|
|
|
|
|
|
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.BattleControlMonster();
|
|
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.BattleControlMonster constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_InitMonster(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
int _side = LuaAPI.xlua_tointeger(L, 2);
|
|
BF.CharacterSpineHelper _helper = (BF.CharacterSpineHelper)translator.GetObject(L, 3, typeof(BF.CharacterSpineHelper));
|
|
UnityEngine.Transform _body = (UnityEngine.Transform)translator.GetObject(L, 4, typeof(UnityEngine.Transform));
|
|
|
|
gen_to_be_invoked.InitMonster( _side, _helper, _body );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_InitHpBar(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.InitHpBar( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_RefreshHpBar(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
float _percent = (float)LuaAPI.lua_tonumber(L, 2);
|
|
|
|
gen_to_be_invoked.RefreshHpBar( _percent );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_InitPosition(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
float _x = (float)LuaAPI.lua_tonumber(L, 2);
|
|
float _y = (float)LuaAPI.lua_tonumber(L, 3);
|
|
float _z = (float)LuaAPI.lua_tonumber(L, 4);
|
|
|
|
gen_to_be_invoked.InitPosition( _x, _y, _z );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_EnterDisappear(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.EnterDisappear( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_ExitDisappear(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.ExitDisappear( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_SetTarget(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
BF.BattleControlUnit _target = (BF.BattleControlUnit)translator.GetObject(L, 2, typeof(BF.BattleControlUnit));
|
|
|
|
gen_to_be_invoked.SetTarget( _target );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_GetIsNormalMonster(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.GetIsNormalMonster( );
|
|
LuaAPI.lua_pushboolean(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_GetIsBOSS(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.GetIsBOSS( );
|
|
LuaAPI.lua_pushboolean(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_StopMove(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.StopMove( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_StartMove(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.StartMove( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_InstantKill(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.InstantKill( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_PlayAirborne(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.PlayAirborne( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_StopAirborne(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.StopAirborne( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_MoveWithSkillAI(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
int _target = LuaAPI.xlua_tointeger(L, 2);
|
|
int _horizontal = LuaAPI.xlua_tointeger(L, 3);
|
|
float _x = (float)LuaAPI.lua_tonumber(L, 4);
|
|
float _z = (float)LuaAPI.lua_tonumber(L, 5);
|
|
int _refresh = LuaAPI.xlua_tointeger(L, 6);
|
|
int _across = LuaAPI.xlua_tointeger(L, 7);
|
|
float _speed = (float)LuaAPI.lua_tonumber(L, 8);
|
|
int _endType = LuaAPI.xlua_tointeger(L, 9);
|
|
float _endValue = (float)LuaAPI.lua_tonumber(L, 10);
|
|
int _collisionType = LuaAPI.xlua_tointeger(L, 11);
|
|
|
|
gen_to_be_invoked.MoveWithSkillAI( _target, _horizontal, _x, _z, _refresh, _across, _speed, _endType, _endValue, _collisionType );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_TowardToTarget(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.TowardToTarget( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_ForceTowardToTarget(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.ForceTowardToTarget( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_BeHitBack(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.BeHitBack( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_OnDead(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.OnDead( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_Clear(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
BF.BattleControlMonster gen_to_be_invoked = (BF.BattleControlMonster)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
gen_to_be_invoked.Clear( );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|