diff --git a/lua/app/module/battle/controller/battle_controller_stage.lua b/lua/app/module/battle/controller/battle_controller_stage.lua index 48d7289f..0aa24fda 100644 --- a/lua/app/module/battle/controller/battle_controller_stage.lua +++ b/lua/app/module/battle/controller/battle_controller_stage.lua @@ -46,7 +46,7 @@ function BattleControllerStage:_stageGenerateNextMonster() monsterComp:initWithEntity(modelId, unitEntity, self) self.defTeam:addUnit(monsterComp, true) self.battleUI:refreshDefHp(unitEntity:getHp(), unitEntity:getHpPercent()) - if not isBoss then -- 如果是boss就跑过去 + if isBoss then -- 如果是boss就跑过去 local count = 0 local function onFinish() count = count + 1 diff --git a/lua/app/ui/battle/battle_ui.lua b/lua/app/ui/battle/battle_ui.lua index 1db95413..7bbf5f35 100644 --- a/lua/app/ui/battle/battle_ui.lua +++ b/lua/app/ui/battle/battle_ui.lua @@ -9,6 +9,10 @@ local DEFAULT_X = 10000 local BOARD_POS_UP = BF.Vector2(0, 47) local BOARD_POS_DOWN = BF.Vector2(0, -740) local BG_PATH = "assets/arts/textures/background/battle/%s.png" +local CacheVector2 = { + x = 0, + y = 0 +} function BattleUI:getPrefabPath() return "assets/prefabs/ui/battle/battle_ui.prefab" @@ -78,7 +82,10 @@ function BattleUI:moveBattlefield(time) self.bgMoveTween:SetIntId(GConst.DOTWEEN_IDS.BATTLE) self.bgMoveTween:SetAutoKill(false) else - self.bgMoveTween:ChangeEndValue(width*3/4, time, true) + local x, y = self.bg:fastGetAnchoredPosition() + CacheVector2.x = width*3/4 + CacheVector2.y = y + self.bgMoveTween:ChangeEndValue(CacheVector2, time, true) self.bgMoveTween:Restart() end end