local UIGuildWarMapInfo = UIViewClass() local MapItemIndex = MDL.GuildWar.MapItemIndex local DefaultState = {state = 0, campId = 0, progress = 0} local FlagPostionX= { One = 0, Two = 0.065, Three = 0.13, Four1 = - 0.19, Four2 = - 0.06, Four3 = 0.07, Four4 = 0.2, Five1 = 0.26, Five2 = 0.13, } local FlagScale = 0.7 local TouShi_Attack = 1 local TouShi_Hit = 2 local LeftToushiche = 1 local LeftBoss = 2 local MiddleLeftToushiche = 3 local MiddleRightToushiche = 4 function UIGuildWarMapInfo:OnOpened(context) UIUtils.SetLabelText(self.UITemplateTitlePanel.lab_Title, Const_IDS.IDS_GuildWar_BattleGroundDetail) UIUtils.SetActive(self.UITemplateTitlePanel.btn_Info, false) if BattleDataGetter.IsGuildWarWaitingArea() then self:ReadySceneInit() self.txt_Info2.text = 0 else self:BattleSceneInit() self.txt_Info2.text = MDL.GuildWar.GetGuildWarResourceCount() end if self.context then self.img_Mask.gameObject:SetActive(false) self.bg.gameObject:SetActive(false) local canvas = self.gameObject:GetComponent(typeof(UnityEngine.Canvas)) canvas.overrideSorting = false UIUtils.SetActive(self.UITemplateTitlePanel.gameObject, false) --这里是作为子界面 需要把界面的overrideSorting勾掉 end self:RegistSystemEvent(EventID.UI_GuildWarResourceUpdate,self.OnResourcesUpdate) end function UIGuildWarMapInfo:BattleSceneInit() MDL.GuildWar.C2GGetGuildWarPlayerScore() for i,v in ipairs(self.group_RightBottom) do v.lab_Left.text = string.FormatByIdsId(Const_IDS.IDS_GuildWar_Team,i) end self:RegistSystemEvent(EventID.UI_GuildWarBigMapUpdate, self.OnMapUpdate) if self.context then self.group_Bright.gameObject:SetActive(false) self.isRevive = true self.mapState:SetState(3) self.group_RightBottom.gameObject:SetActive(false) end if BattleDataGetter.GetCurLevelType() == LuaConst.LevelType.SyncGuildWarMapResources then self.group_RightBottom.gameObject:SetActive(false) self.mapState:SetState(1) else local dropGos = {} self.mapItemToIndex = {} self.flagItemToIndex = {} self.flagItemPos = {} table.insert(dropGos, self.flag_bg.gameObject) dropGos = self:InitDropItem(dropGos) for i, v in ipairs(self.group_RightBottom) do if MDL.GuildWar.IsHasPlayer(i) then self:RegistTriggerEvent(v.btn_Flag, UIEventTriggerType.BeginDrag) if MDL.GuildWar.IsBattleLeader(BattleDataGetter.GetAcID()) then self:RegistTriggerEvent(v.btn_Flag, UIEventTriggerType.Drag) self:RegistTriggerEvent(v.btn_Flag, UIEventTriggerType.EndDrag) self:RegistDropEvent(v.btn_Flag,dropGos) end self.flagItemToIndex[v.btn_Flag.gameObject] = i self.flagItemPos[v.btn_Flag.gameObject] = {v.btn_Flag.transform:GetAnchoredPosition()} else v.gameObject:SetActive(false) end end self.inMapItemFlag = {} end self:StartRepeatFunc(self.OnUpdateFun, 1) self:OnUpdateFun() UnityEngine.Input.multiTouchEnabled = false end function UIGuildWarMapInfo:ReadySceneInit() self.group_CityHp.img_Blue.fillAmount = 1 self.group_CityHp.img_Red.fillAmount = 1 self.group_CityHp.txt_BlueHp.text = MDL.GuildWar.MaxGuildWarBaseHp.."/".. MDL.GuildWar.MaxGuildWarBaseHp self.group_CityHp.txt_RedHp.text = MDL.GuildWar.MaxGuildWarBaseHp.."/".. MDL.GuildWar.MaxGuildWarBaseHp UIUtils.SetGray(self.Group_MapItem.Wharf.img_boss, true) UIUtils.SetGray(self.Group_MapItem.Highland.img_boss, true) self.Group_MapItem.Wharf.img_CatapultCamp.state:SetState(0) self.Group_MapItem.Wharf.img_CatapultCamp.img_OccupiedBar_Red.fillAmount = 0 self.Group_MapItem.Middle.img_SiegeCar.state:SetState(0) self.Group_MapItem.Middle.img_SiegeCar.img_OccupiedBar_Red.fillAmount = 0 self.Group_MapItem.Middle.img_CatapultCamp_1.state:SetState(0) self.Group_MapItem.Middle.img_CatapultCamp_1.img_OccupiedBar_Red.fillAmount = 0 self.Group_MapItem.Middle.img_CatapultCamp_2.state:SetState(0) self.Group_MapItem.Middle.img_CatapultCamp_2.img_OccupiedBar_Red.fillAmount = 0 self.Group_MapItem.Highland.img_CatapultCamp.state:SetState(0) self.Group_MapItem.Highland.img_CatapultCamp.img_OccupiedBar_Red.fillAmount = 0 for i, v in ipairs(self.group_RightBottom) do if MDL.GuildWar.IsHasPlayer(i) then self:RegistTriggerEvent(v.btn_Flag, UIEventTriggerType.BeginDrag) else v.gameObject:SetActive(false) end end end function UIGuildWarMapInfo:InitDropItem(dropGos) if BattleDataGetter.GetCurLevelType() == LuaConst.LevelType.SyncGuildWarMapLeft then table.insert(dropGos, self.Group_MapItem.Wharf.img_CatapultCamp.dragSlot.gameObject) table.insert(dropGos, self.Group_MapItem.Wharf.img_boss.gameObject) table.insert(dropGos, self.Group_MapItem.Wharf.group_EnemyCity.img_City.gameObject) table.insert(dropGos, self.Group_MapItem.Wharf.group_MyCity.img_City.gameObject) self.mapItemToIndex[self.Group_MapItem.Wharf.img_CatapultCamp.dragSlot.gameObject] = MapItemIndex.LeftTouShi self.mapItemToIndex[self.Group_MapItem.Wharf.img_boss.gameObject] = MapItemIndex.LeftBoss self.mapItemToIndex[self.Group_MapItem.Wharf.group_EnemyCity.img_City.gameObject] = MapItemIndex.LeftEnemyCity self.mapItemToIndex[self.Group_MapItem.Wharf.group_MyCity.img_City.gameObject] = MapItemIndex.LeftMyCity self.mapState:SetState(0) elseif BattleDataGetter.GetCurLevelType() == LuaConst.LevelType.SyncGuildWarMapMiddle then table.insert(dropGos, self.Group_MapItem.Middle.img_SiegeCar.dragSlot.gameObject) table.insert(dropGos, self.Group_MapItem.Middle.img_CatapultCamp_1.dragSlot.gameObject) table.insert(dropGos, self.Group_MapItem.Middle.img_CatapultCamp_2.dragSlot.gameObject) table.insert(dropGos, self.Group_MapItem.Middle.group_EnemyCity.img_City.gameObject) table.insert(dropGos, self.Group_MapItem.Middle.group_MyCity.img_City.gameObject) self.mapItemToIndex[self.Group_MapItem.Middle.img_SiegeCar.dragSlot.gameObject] = MapItemIndex.MiddleChongChe self.mapItemToIndex[self.Group_MapItem.Middle.img_CatapultCamp_2.dragSlot.gameObject] = MapItemIndex.MiddleLeftTouShi self.mapItemToIndex[self.Group_MapItem.Middle.img_CatapultCamp_1.dragSlot.gameObject] = MapItemIndex.MiddleRightTouShi self.mapItemToIndex[self.Group_MapItem.Middle.group_EnemyCity.img_City.gameObject] = MapItemIndex.MiddleEnemyCity self.mapItemToIndex[self.Group_MapItem.Middle.group_MyCity.img_City.gameObject] = MapItemIndex.MiddleMyCity self.mapState:SetState(2) else self.mapState:SetState(1) end return dropGos end function UIGuildWarMapInfo:OnClosed() UIUtils.SetActive(self.UITemplateTitlePanel.btn_Info, true) UIUtils.SetActive(self.UITemplateTitlePanel.gameObject, true) UnityEngine.Input.multiTouchEnabled = true end function UIGuildWarMapInfo:OnBackButtonPressed() self:OnButtonClicked(self.UITemplateTitlePanel.btn_close) end function UIGuildWarMapInfo:OnButtonClicked(comp) if comp == self.btn_Open then self.group_LeftBottom_Large.gameObject:SetActive(true) self.group_LeftBottom.gameObject:SetActive(false) elseif comp == self.btn_Retract then self.group_LeftBottom_Large.gameObject:SetActive(false) self.group_LeftBottom.gameObject:SetActive(true) elseif comp == self.UITemplateTitlePanel.btn_close then self:CloseView() elseif comp == self.UITemplateTitlePanel.btn_Home then CTL.HomeMain.CloseViewBackHomeMain() elseif comp == self.group_Search then UIManager.OpenView(Const_UI_Lua.UIEnum.UIDescriptionPanel, {target = self.descPos, posType = LuaConst.DescriptionPanelType.RightUpper, text = UIUtils.GetLocalizedTxt(Const_IDS.IDS_GuildWar_MiniMapSupportTips)},"GuildWar/UIGuildWarDescriptionPanel") else for i, v in ipairs(self.player_Group) do if comp == v.btn then local index = i > 1 and i + 1 or 1 CTL.PlayerInteract.OpenFriendInteractView(self.showPlayerInfo[index].acid) end end end end function UIGuildWarMapInfo:OnUpdateFun(deltaTime, timeSinceUpdate) MDL.GuildWar.C2GGetGuildWarMapInfo() local data = MDL.GuildWar.GetBattleInfo() data.selfCamp.hpValue = data.selfCamp.hpValue or MDL.GuildWar.MaxGuildWarBaseHp data.enemyCamp.hpValue = data.enemyCamp.hpValue or MDL.GuildWar.MaxGuildWarBaseHp self.group_CityHp.img_Blue.fillAmount = data.selfCamp.hpValue / MDL.GuildWar.MaxGuildWarBaseHp self.group_CityHp.img_Red.fillAmount = data.enemyCamp.hpValue / MDL.GuildWar.MaxGuildWarBaseHp self.group_CityHp.txt_BlueHp.text = data.selfCamp.hpValue.."/".. MDL.GuildWar.MaxGuildWarBaseHp self.group_CityHp.txt_RedHp.text = data.enemyCamp.hpValue.."/".. MDL.GuildWar.MaxGuildWarBaseHp end function UIGuildWarMapInfo:OnMapUpdate(commands,bigMapInfo, playerInfos) if BattleDataGetter.GetCurLevelType() ~= LuaConst.LevelType.SyncGuildWarMapResources and not self.isRevive then self.serverFlags = {} self.emptyTeams = {} for i,v in ipairs(commands) do if v.roomType == MDL.GuildWar.GetRoomTypeByLevelType() then if v.targetId > 0 then self.serverFlags[v.targetId] = self.serverFlags[v.targetId] or {} table.insert(self.serverFlags[v.targetId],v.teamId) else table.insert(self.emptyTeams,v.teamId) end end end if self.curDragObj == nil then for targetId,teams in pairs(self.serverFlags) do local slotObj = self:GetSlotObjByTargetId(targetId) if not self:IsChangeSlot(targetId,teams) then self.inMapItemFlag[slotObj]= {} for _,teamId in ipairs(teams) do local obj = self:GetFlagByTeamId(teamId) table.insert(self.inMapItemFlag[slotObj],obj) self.group_RightBottom[teamId].lab_Left.gameObject:SetActive(false) end end self:SetPostion(slotObj,self.inMapItemFlag[slotObj]) end self:FixFlagScale() end for i,v in ipairs(self.emptyTeams) do local obj = self:GetFlagByTeamId(v) local pos = self.flagItemPos[obj.gameObject] obj.transform:SetAnchoredPosition( pos[1], pos[2]) self.group_RightBottom[v].lab_Left.gameObject:SetActive(true) end end self:SetMapAllElement(bigMapInfo) self:SetPlayerInfo(playerInfos) end function UIGuildWarMapInfo:SetMapAllElement(bigMapInfo) local elements = MDL.GuildWar.GetElements() -- 左战场boss是否活着 --bigMapInfo.mapInfoLeft.bossAlive -- 右战场boss是否活着 Wharf --bigMapInfo.mapInfoRight.bossAlive self:SetMapElement(bigMapInfo.mapInfoMiddle.info,self.Group_MapItem.Middle.img_SiegeCar,elements[2].ElementID) -- 中战场冲车 self:SetMapElement(bigMapInfo.mapInfoLeft.info,self.Group_MapItem.Wharf.img_CatapultCamp,elements[5].ElementID) -- 右战场 if MDL.GuildWar.IsMirrorMap() then self:SetMapElement(bigMapInfo.mapInfoMiddle.info,self.Group_MapItem.Middle.img_CatapultCamp_2,elements[4].ElementID) -- 中战场左路投石车 self:SetMapElement(bigMapInfo.mapInfoMiddle.info,self.Group_MapItem.Middle.img_CatapultCamp_1,elements[3].ElementID) -- 中战场右路投石车 else self:SetMapElement(bigMapInfo.mapInfoMiddle.info,self.Group_MapItem.Middle.img_CatapultCamp_2,elements[3].ElementID) -- 中战场左路投石车 self:SetMapElement(bigMapInfo.mapInfoMiddle.info,self.Group_MapItem.Middle.img_CatapultCamp_1,elements[4].ElementID) -- 中战场右路投石车 end UIUtils.SetGray(self.Group_MapItem.Wharf.img_boss, not bigMapInfo.mapInfoLeft.bossAlive) end function UIGuildWarMapInfo:SetMapElement(bigMapInfo, obj, elementID) local info = self:GetMapInfoById(bigMapInfo,elementID) if not info then info = DefaultState end if info then local isSelf = BattleDataGetter.GetMyCampID() == info.campId local progressObj = nil if isSelf then if info.state == 3 then obj.state:SetState(3) progressObj = obj.img_Blue obj.bg.gameObject:SetActive(false) else obj.state:SetState(1) progressObj = obj.img_OccupiedBar_Blue obj.bg.gameObject:SetActive(true) end else if info.state == 3 then obj.state:SetState(2) progressObj = obj.img_Red obj.bg.gameObject:SetActive(false) else obj.state:SetState(0) progressObj = obj.img_OccupiedBar_Red obj.bg.gameObject:SetActive(true) end end progressObj.fillAmount = info.progress end end function UIGuildWarMapInfo:GetMapInfoById(info,id) for i,v in ipairs(info) do if v.levelItemId == id then return v end end end function UIGuildWarMapInfo:IsChangeSlot(targetId,teams) local slotObj = self:GetSlotObjByTargetId(targetId) if self.inMapItemFlag[slotObj] and #teams == #self.inMapItemFlag[slotObj] then for _,teamId in ipairs(teams) do local isExit = false local obj = self:GetFlagByTeamId(teamId) for i,v in ipairs(self.inMapItemFlag[slotObj]) do if v == obj then isExit = true break end end if isExit == false then return true end end end return false end function UIGuildWarMapInfo:GetSlotObjByTargetId(targetId) if BattleDataGetter.GetCurLevelType() ~= LuaConst.LevelType.SyncGuildWarMapResources then for k,v in pairs(self.mapItemToIndex) do if v == targetId then return k end end end end function UIGuildWarMapInfo:GetFlagByTeamId(teamId) return self.group_RightBottom[teamId].btn_Flag end --------------- drag and drop ---------------- function UIGuildWarMapInfo:OnBeginDrag(comp, eventData) if MDL.GuildWar.IsBattleLeader(BattleDataGetter.GetAcID()) then if BattleDataGetter.IsGuildWarWaitingArea() then return CTL.Tips.AddTipsMsg(Const_IDS.IDS_GuildWarInReadyScene) end self.curDragObj = comp.gameObject self.dragAnchorPosX, self.dragAnchorPosY = comp.transform:GetAnchoredPosition() self:SetInMapFlagHide(false) self:ActiveDragItem(true) else CTL.Tips.AddTipsMsg(Const_IDS.IDS_Guild_CommonFail4) end end function UIGuildWarMapInfo:OnDrag(comp, eventData) UIUtils.ScreenPointToWorldPointInRectangle(self.curDragObj, eventData) end function UIGuildWarMapInfo:OnEndDrag(comp, eventData) if self.dragAnchorPosX and self.dragAnchorPosY then comp.transform:SetAnchoredPosition(self.dragAnchorPosX, self.dragAnchorPosY) end self:ActiveDragItem(false) end function UIGuildWarMapInfo:OnDrop(comp, eventData) self:SetInMapFlagHide(true) if comp == nil then self.curDragObj = nil return end if not eventData.pointerEnter or not self.curDragObj or self.curDragObj ~= eventData.pointerDrag then self.dragItemId = nil self.curDragObj = nil return end local dragItemIndex = self.flagItemToIndex[eventData.pointerDrag] local dropItemIndex = self.mapItemToIndex[comp.gameObject] if dropItemIndex then self:AddFlag(comp.gameObject,eventData.pointerDrag,dragItemIndex) MDL.GuildWar.C2GGuildWarCommandTeam(dragItemIndex,dropItemIndex,BattleDataGetter.GetPlayerName()) else local pos = self.flagItemPos[eventData.pointerDrag] self.curDragObj.transform:SetAnchoredPosition( pos[1], pos[2]) self:RemoveFlag(eventData.pointerDrag) self.curDragObj.transform:SetLocalScale(1,1,1) MDL.GuildWar.C2GGuildWarCommandTeam(dragItemIndex,-1,BattleDataGetter.GetPlayerName()) end self.curDragObj = nil self.dragAnchorPosX = nil self.dragAnchorPosY = nil end function UIGuildWarMapInfo:AddFlag(slotObj,flagObj,dropItemIndex) self.inMapItemFlag[slotObj] = self.inMapItemFlag[slotObj] or {} local count = #self.inMapItemFlag[slotObj] table.insert(self.inMapItemFlag[slotObj],flagObj) self:SetPostion(slotObj,self.inMapItemFlag[slotObj]) self.group_RightBottom[dropItemIndex].lab_Left.gameObject:SetActive(false) end function UIGuildWarMapInfo:RemoveFlag(flagObj,dropItemIndex) for k,v in pairs(self.inMapItemFlag) do for i,flag in ipairs(v) do if flagObj == flag then table.remove(v,i) self:SetPostion(k,v) return end end end end function UIGuildWarMapInfo:SetPostion(slotObj, flagObjs) --这里因为要排序 根据数量设定位置 坐标写死 local x, y = slotObj.transform:GetPosition() local flagTopY = y + 0.15 local flagBottomY = y - 0.15 local flagScale = 0.7 if #flagObjs == 1 then flagObjs[1].transform:SetPosition(x + FlagPostionX.One, flagTopY) self:ScaleFlag(flagObjs, 1) elseif #flagObjs == 2 then flagObjs[1].transform:SetPosition(x - FlagPostionX.Two, flagTopY) flagObjs[2].transform:SetPosition(x + FlagPostionX.Two, flagTopY) self:ScaleFlag(flagObjs, 2) elseif #flagObjs == 3 then flagObjs[1].transform:SetPosition(x - FlagPostionX.Three, flagTopY) flagObjs[2].transform:SetPosition(x, flagTopY) flagObjs[3].transform:SetPosition(x + FlagPostionX.Three, flagTopY) self:ScaleFlag(flagObjs, 3) elseif #flagObjs == 4 then flagObjs[1].transform:SetPosition(x + FlagPostionX.Four1, flagTopY) flagObjs[2].transform:SetPosition(x + FlagPostionX.Four2, flagTopY) flagObjs[3].transform:SetPosition(x + FlagPostionX.Four3, flagTopY) flagObjs[4].transform:SetPosition(x + FlagPostionX.Four4, flagTopY) self:ScaleFlag(flagObjs, 4) elseif #flagObjs == 5 then flagObjs[1].transform:SetPosition(x - FlagPostionX.Five1, flagTopY) flagObjs[2].transform:SetPosition(x - FlagPostionX.Five2, flagTopY) flagObjs[3].transform:SetPosition(x, flagTopY) flagObjs[4].transform:SetPosition(x + FlagPostionX.Five1, flagTopY) flagObjs[5].transform:SetPosition(x + FlagPostionX.Five2, flagTopY) self:ScaleFlag(flagObjs, 5) elseif #flagObjs == 6 then flagObjs[1].transform:SetPosition(x + FlagPostionX.Four1, flagTopY) flagObjs[2].transform:SetPosition(x + FlagPostionX.Four2, flagTopY) flagObjs[3].transform:SetPosition(x + FlagPostionX.Four3, flagTopY) flagObjs[4].transform:SetPosition(x + FlagPostionX.Four4, flagTopY) flagObjs[5].transform:SetPosition(x - FlagPostionX.Two, flagBottomY) flagObjs[6].transform:SetPosition(x + FlagPostionX.Two, flagBottomY) self:ScaleFlag(flagObjs, 6) elseif #flagObjs == 7 then flagObjs[1].transform:SetPosition(x + FlagPostionX.Four1, flagTopY) flagObjs[2].transform:SetPosition(x + FlagPostionX.Four2, flagTopY) flagObjs[3].transform:SetPosition(x + FlagPostionX.Four3, flagTopY) flagObjs[4].transform:SetPosition(x + FlagPostionX.Four4, flagTopY) flagObjs[5].transform:SetPosition(x - FlagPostionX.Three, flagBottomY) flagObjs[6].transform:SetPosition(x, flagBottomY) flagObjs[7].transform:SetPosition(x + FlagPostionX.Three, flagBottomY) self:ScaleFlag(flagObjs, 7) end end function UIGuildWarMapInfo:ScaleFlag(flagObjs, index) for i=1,index do flagObjs[i].transform:SetLocalScale(FlagScale, FlagScale, FlagScale) end end function UIGuildWarMapInfo:SetInMapFlagHide(active) for k,v in pairs(self.inMapItemFlag) do for i,flag in ipairs(v) do flag.transform:GetComponentInChildren(typeof(Image)).raycastTarget = active end end end function UIGuildWarMapInfo:ActiveDragItem(active) local obj = nil if BattleDataGetter.GetCurLevelType() == LuaConst.LevelType.SyncGuildWarMapLeft then obj = self.group_Bright[2] elseif BattleDataGetter.GetCurLevelType() == LuaConst.LevelType.SyncGuildWarMapMiddle then obj = self.group_Bright[1] elseif BattleDataGetter.GetCurLevelType() == LuaConst.LevelType.SyncGuildWarMapRight then obj = self.group_Bright[3] end obj.gameObject:SetActive(active) self.group_Bright.gameObject:SetActive(active) end function UIGuildWarMapInfo:FixFlagScale() if MDL.GuildWar.IsBattleLeader(BattleDataGetter.GetAcID()) then for i,v in ipairs(self.group_RightBottom) do local posX, posY = v.btn_Flag.transform:GetAnchoredPosition() if posX == 0 then local scale = v.btn_Flag.transform:GetLocalScale() if math.abs(scale - FlagScale) < 0.01 then v.btn_Flag.transform:SetLocalScale(1, 1, 1) end end end end end function UIGuildWarMapInfo:SetPlayerInfo(playerInfos) self.showPlayerInfo = playerInfos local index = 1 if MDL.GuildWar.IsMirrorMap() then local temp = playerInfos[3] playerInfos[3] = playerInfos[4] playerInfos[4] = temp end for i, v in ipairs(playerInfos) do --第二个是boss 没有玩家数据 if i ~= 2 then if not string.isNilOrEmpty(v.acid) then UIUtils.SetActive(self.player_Group[index].gameObject, true) CTL.Character.SetPortraitAndFrame(self.player_Group[index].UIHeroHead, v.portraitId) else UIUtils.SetActive(self.player_Group[index].gameObject, false) end index = index + 1 end self:PlayerStateEffect(i, v.state, v.campId) end end function UIGuildWarMapInfo:PlayerStateEffect(index, state, campId) if index == LeftBoss then if state == TouShi_Hit then self.Group_MapItem.Wharf.bossStateEffect:PlayUIEffect(ConstAssetPathConfig.AssetPath136, 1) end else local effectComp = nil if index == LeftToushiche then effectComp = self.Group_MapItem.Wharf.img_CatapultCamp.stateEffect elseif index == MiddleLeftToushiche then effectComp = self.Group_MapItem.Middle.img_CatapultCamp_1.stateEffect elseif index == MiddleRightToushiche then effectComp = self.Group_MapItem.Middle.img_CatapultCamp_2.stateEffect end if state == TouShi_Attack then if campId == BattleDataGetter.GetMyCampID() then effectComp:PlayUIEffect(ConstAssetPathConfig.AssetPath137, 1) else effectComp:PlayUIEffect(ConstAssetPathConfig.Path27, 1) end end end end function UIGuildWarMapInfo:OnResourcesUpdate(resources) if self.showResourcesParamDict then CTL.GuildWar.ShowResources(self, resources, self.oldResources, self.showResourcesParamDict) self.oldResources = resources else self.showResourcesParamDict = {Txt_AddNum = self.Txt_AddNum, txt_Num = self.txt_Info2, updateFun = self.ShowResourcesUpdateFun} self.txt_Info2.text = resources self.oldResources = resources end end function UIGuildWarMapInfo:ShowResourcesUpdateFun(deltaTime, timeSinceUpdate) CTL.GuildWar.ShowResourcesUpdateFun(deltaTime, timeSinceUpdate, self.showResourcesParamDict,self) end return UIGuildWarMapInfo