local UIHeroAwakenBattleInfo = UIViewClass() function UIHeroAwakenBattleInfo:OnOpened(context) self:RegistSystemEvent(EventID.UIBattle_Level_SetUpBoss, self.SetUpBoss) local entity = BattleDataGetter.GetHeroInHeroEntityTableByIndex(LuaConst.STANDALONE_ENEMYPLAYER1_PLAYID, 1) if entity then self:SetUpBoss(true, nil, entity.EntityID) end end function UIHeroAwakenBattleInfo:SetUpBoss(active, monsterId, entityID) if active then if not self.bossHpView then self.bossHpView = self.bossHPRoot:OpenView(GetViewClass(Const_UI_Lua.UIEnum.UIHeroAwakenBossHp), { entityID = entityID }, Const_UI_Lua.UIEnum.UIBattleBossBattleInfoView) else self.bossHpView:ActiveUI({ entityID = entityID }) --这里临时先这么改吧 如果有两个boss切换血条 会不正确 end else if self.bossHpView then self.bossHpView:HideUI() end end end function UIHeroAwakenBattleInfo:OnButtonClicked(comp) if comp == self.btn_Exit then CTL.Setting.BackToTown() elseif comp == self.btn_Setting then UIManager.OpenView(Const_UI_Lua.UIEnum.UISettingMainPanel) end end return UIHeroAwakenBattleInfo