清理战斗

This commit is contained in:
chenxi 2023-04-12 18:31:30 +08:00
parent 89497ab68e
commit dc66b8833a

View File

@ -15,6 +15,10 @@ function BattleUI:getPrefabPath()
return "assets/prefabs/ui/battle/battle_ui.prefab"
end
function BattleUI:onClose()
self:clear()
end
function BattleUI:onLoadRootComplete()
self:_display()
self:_addListeners()
@ -264,4 +268,15 @@ function BattleUI:fallGrid(listInfo, callback)
end
end
function BattleUI:clear()
if self.alreadyClear then
return
end
self.alreadyClear = true
if self.battleNode then
self.battleNode:removeAllChildren()
end
end
return BattleUI