require("Modules.Battle.Logic.Weapon.FightWeapon") FightWeaponManager = {} local this = FightWeaponManager function FightWeaponManager.Init() this.monsterList = {} -- 初始化灵兽技能管理 -- if MSkillManager.isInit==false then -- LogError("初始化 ====================mskikkmanager") -- MSkillManager.Init() -- end WeaponSkillManager.Init() end function FightWeaponManager.AddWeapon(data) local index = data.camp * 6 + data.position local monster = FightWeapon:New() monster:Init(data) if not this.monsterList then this.monsterList = {} end this.monsterList[index] = monster BattleLogic.Event:DispatchEvent(BattleEventName.AddWeapon, monster) end -- 获取角色数据 function this.GetMonster(camp, pos) local index = camp * 6 + pos return this.monsterList[index] end function FightWeaponManager.Update() end -- 切换时使用(已废弃) function FightWeaponManager.ClearEnemy() local removePos = {} for pos, obj in pairs(this.monsterList) do if obj.camp == 1 then removePos[pos] = 1 BattleLogic.Event:DispatchEvent(BattleEventName.RemoveMonster, obj) obj:Dispose() end end for pos, _ in pairs(removePos) do this.monsterList[pos] = nil end end return FightWeaponManager