local UIBattleBuffPanel = require "View/SyncTeamPVP/UIBattleTeamPVPBattlePanel" local UIReplayTeamPVPBattlePanel = UIViewClass(UIBattleBuffPanel) function UIReplayTeamPVPBattlePanel:StartRepeat() self:StartRepeatFunc(self.OnUpdateFun, 0, -1, true, false) end function UIReplayTeamPVPBattlePanel:OnEntityRevive(entity) if entity._logicInitData.IsPlayerSelf then --UIManager.OpenView(Const_UI_Lua.UIEnum.UISyncTeamPVPRevive) gws :回放不打开死亡计时界面感觉更舒服些 end self:RefreshPlayer(entity) end function UIReplayTeamPVPBattlePanel:InitPlayer(entity, index, isEnemy) if index > 3 then return -- 3v3正常是6个人 也只有6个头像 超过会报错 但是测试过程中 可能有超过6个人 这么写一下 如果判断celltable 有其它问题可能给检测不到 end local roleId = entity._logicInitData.CharacterID local cellTable = nil if isEnemy then cellTable = self.enemyList[index] else cellTable = self.friendList[index] end --头像只加载一次 if self.hasLoadPlayerHeadImg == false then UTL.Item.SetHeroIconByHeroId(cellTable.texture_HeadImg, roleId, BattleDataGetter.GetHeroIsAwaken(entity:GetPlayerID(), roleId)) UIUtils.SetLabel(cellTable.txt_Name, entity._logicInitData.Name) local entityId = entity:GetEntityID() if entity:IsPlayerSelf() then self.friendEntityBuffPanel[index] = self.friendList[index].buffCanvas:OpenView(GetViewClass(Const_UI_Lua.UIEnum.UIBattleBuffPanel), {entityId = entityId, buffType = LuaConst.UIBuffShowType.PlayerSelf}, "SyncTeamPVP/UISyncTeamBuffLeft") else if isEnemy then self.enemyEntityBuffPanel[index] = self.enemyList[index].buffCanvas:OpenView(GetViewClass(Const_UI_Lua.UIEnum.UIBattleBuffPanel), {entityId = entityId, buffType = LuaConst.UIBuffShowType.PlayerOthers},"SyncTeamPVP/UISyncTeamBuffRight") else self.friendEntityBuffPanel[index] = self.friendList[index].buffCanvas:OpenView(GetViewClass(Const_UI_Lua.UIEnum.UIBattleBuffPanel), {entityId = entityId, buffType = LuaConst.UIBuffShowType.PlayerOthers}, "SyncTeamPVP/UISyncTeamBuffLeft") end end end cellTable.txt_01.text = tostring(entity.components.record.TotalKillNum) cellTable.txt_02.text = tostring(entity.components.record.DeadCount) cellTable.sprite_HpFg_Show.fillAmount = FP.tonumberV1(entity.components.attr.hp / entity.components.attr:GetAttrValue(LuaConst.AttrType.hplmt)) if CampManager.IsEnemyCamp(entity._logicInitData.EntityCampID, LevelPlayerManager.MainEntityCampID) then --UIUtils.SetImageByAssetBundle(cellTable.sprite_HpFg_Show, RedHpBarImgPath) end local reviveTime = entity.components.revive.ReviveTimer if reviveTime > 0 then if not self.isDead[entity._logicInitData.CharacterID] then self.isDead[entity._logicInitData.CharacterID] = reviveTime cellTable.timer:ResetAndBeginTimer(false, reviveTime / 1000) cellTable.sprite_HpFg_Show.fillAmount = 1 end end self.isDead[entity._logicInitData.CharacterID] = nil end return UIReplayTeamPVPBattlePanel