还原测试代码

This commit is contained in:
chenxi 2023-04-20 22:49:56 +08:00
parent e7c01c9c5d
commit de5d0e34e5
2 changed files with 9 additions and 2 deletions

View File

@ -46,7 +46,7 @@ function BattleControllerStage:_stageGenerateNextMonster()
monsterComp:initWithEntity(modelId, unitEntity, self) monsterComp:initWithEntity(modelId, unitEntity, self)
self.defTeam:addUnit(monsterComp, true) self.defTeam:addUnit(monsterComp, true)
self.battleUI:refreshDefHp(unitEntity:getHp(), unitEntity:getHpPercent()) self.battleUI:refreshDefHp(unitEntity:getHp(), unitEntity:getHpPercent())
if not isBoss then -- 如果是boss就跑过去 if isBoss then -- 如果是boss就跑过去
local count = 0 local count = 0
local function onFinish() local function onFinish()
count = count + 1 count = count + 1

View File

@ -9,6 +9,10 @@ local DEFAULT_X = 10000
local BOARD_POS_UP = BF.Vector2(0, 47) local BOARD_POS_UP = BF.Vector2(0, 47)
local BOARD_POS_DOWN = BF.Vector2(0, -740) local BOARD_POS_DOWN = BF.Vector2(0, -740)
local BG_PATH = "assets/arts/textures/background/battle/%s.png" local BG_PATH = "assets/arts/textures/background/battle/%s.png"
local CacheVector2 = {
x = 0,
y = 0
}
function BattleUI:getPrefabPath() function BattleUI:getPrefabPath()
return "assets/prefabs/ui/battle/battle_ui.prefab" 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:SetIntId(GConst.DOTWEEN_IDS.BATTLE)
self.bgMoveTween:SetAutoKill(false) self.bgMoveTween:SetAutoKill(false)
else 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() self.bgMoveTween:Restart()
end end
end end