计算战斗力卡顿的问题优化

dev_chengFeng
gaoxin 2020-08-03 15:36:29 +08:00
parent 880b52763f
commit 70cd06da2b
1 changed files with 11 additions and 6 deletions

View File

@ -119,7 +119,7 @@ function this.RefreshFormation(index, roleList, pokemonList,isDiffmonster)
Game.GlobalEvent:DispatchEvent(GameEvent.Formation.OnFormationChange,isDiffmonster)
end)
this.UserPowerChanged()
this.CheckHeroIdExist()
end
@ -209,13 +209,18 @@ end
--某个妖灵师战力发生变化检查是否在任何一个编队
function this.CheckHeroIdExist(heroId)
for _, formationData in pairs(this.formationList) do
table.walk(formationData.teamHeroInfos, function(teamInfo)
if heroId == teamInfo.heroId then
this.UserPowerChanged()
if not heroId then
NetManager.RequestUserForceChange(FormationTypeDef.FORMATION_NORMAL)
return
end
-- for _, formationData in pairs(this.formationList) do
table.walk(this.formationList[FormationTypeDef.FORMATION_NORMAL].teamHeroInfos, function(teamInfo)
if heroId == teamInfo.heroId then
NetManager.RequestUserForceChange(FormationTypeDef.FORMATION_NORMAL)
end
end)
end
-- end
end
function this.UserPowerChanged()