require("Base/BasePanel") GongMingResultTips = Inherit(BasePanel) local this = GongMingResultTips local curSelectHeroList={} local heroDataList={} local curNeedRoleNum local openThisPanel local curHeroData = {} local TempData = nil; local SelectHero = nil local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig) --初始化组件(用于子类重写) function GongMingResultTips:InitComponent() this.BtnBack = Util.GetGameObject(self.transform, "btnBack") this.TextOneAll = Util.GetGameObject(self.transform,"grid/TextOne") this.TextTwoAll = Util.GetGameObject(self.transform,"grid/TextTwo") this.HeroSkin = Util.GetGameObject(self.transform,"grid/ver/HeroSkin") end --绑定事件(用于子类重写) function GongMingResultTips:BindEvent() Util.AddClick(this.BtnBack, function() self:ClosePanel() end) end --添加事件监听(用于子类重写) function GongMingResultTips:AddListener() end --移除事件监听(用于子类重写) function GongMingResultTips:RemoveListener() end local LingDegree = -1 local HunDegree = -1 function GongMingResultTips:OnOpen(flag) --共鸣前 local SelectId = HarmonyManager:GetUnLoadData() local herodata = HeroManager.GetSingleHeroData(SelectId) local heroTData=nil if herodata.skinId and herodata.skinId>0 then heroTData=ConfigManager.GetConfigDataByKey(ConfigName.HeroSkin,"Type",herodata.skinId) else heroTData= ConfigManager.GetConfigData(ConfigName.HeroConfig,herodata.id) end this.liveName = GetResourcePath(heroTData.Live) this.liveNode = poolManager:LoadLive(this.liveName, this.HeroSkin.transform, Vector3.one * heroTData.Scale, Vector3.New(heroTData.Position[1], heroTData.Position[2])) -- this.liveNode.transform.sizeDelta = Vector2.New(1000, 1000) this.HeroSkin:GetComponent("RectTransform").localScale = Vector2.New(0.7,0.7) local SkeletonGraphic = this.liveNode:GetComponent("SkeletonGraphic") local idle = function() SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true) end SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true) SkeletonGraphic.AnimationState.Complete = SkeletonGraphic.AnimationState.Complete + idle poolManager:SetLiveClearCall(this.liveName, this.liveNode, function() SkeletonGraphic.AnimationState.Complete = SkeletonGraphic.AnimationState.Complete - idle end) --共鸣后 if flag then -- body Util.GetGameObject(this.TextOneAll,"textDegree"):GetComponent("Text").text = string.format("%d",herodata.oriLv) Util.GetGameObject(this.TextOneAll,"textEqiue"):GetComponent("Text").text = "无" Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = "无" Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = "无" Util.GetGameObject(this.TextOneAll,"textFa"):GetComponent("Text").text = "无" -- if EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[2]) then -- -- body -- if EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[2]).lv then -- Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = string.format("%d",EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[2]).lv) -- LingDegree = EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[2]).lv -- end -- else -- end -- if EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[1]) then -- -- body -- if EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[1]).lv then -- -- body -- Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = string.format("%d",EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[1]).lv) -- HunDegree = EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[1]).lv -- end -- end -- Util.GetGameObject(this.TextOneAll,"textFa"):GetComponent("Text").text = string.format("%d",herodata.talismanList) if HeroManager.IsTenTalent(herodata.star) then -- body Util.GetGameObject(this.TextTwoAll,"textDegree"):GetComponent("Text").text = HarmonyManager.hongmengTablet else Util.GetGameObject(this.TextTwoAll,"textDegree"):GetComponent("Text").text = herodata.lv end Util.GetGameObject(this.TextTwoAll,"textEqiue"):GetComponent("Text").text = "无" Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = "无" Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text = "无" Util.GetGameObject(this.TextTwoAll,"textFa"):GetComponent("Text").text = "无" -- local data = HarmonyManager:GetAdditions() -- for i = 1, #data do -- if data[i].additionType == 1 then -- Util.GetGameObject(this.TextTwoAll,"textDegree"):GetComponent("Text").text = string.format("%d",data[i].value) -- elseif data[i].additionType == 2 then -- if data[i].value == -1 then -- Util.GetGameObject(this.TextTwoAll,"textEqiue"):GetComponent("Text").text = string.format("无") -- else -- Util.GetGameObject(this.TextTwoAll,"textEqiue"):GetComponent("Text").text = string.format("%d",data[i].value) -- end -- -- body -- elseif data[i].additionType == 3 then -- if HunDegree >data[i].value then -- -- body -- Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = string.format("%d",HunDegree) -- else -- Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = string.format("%d",data[i].value) -- end -- -- body -- elseif data[i].additionType == 4 then -- if LingDegree>data[i].value then -- Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text =string.format("%d",LingDegree) -- else -- Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text =string.format("%d",data[i].value) -- end -- -- body -- else -- Util.GetGameObject(this.TextTwoAll,"textFa"):GetComponent("Text").text =string.format("%d",data[i].value) -- end -- end else Util.GetGameObject(this.TextOneAll,"textDegree"):GetComponent("Text").text = string.format("%d",herodata.oriLv) Util.GetGameObject(this.TextOneAll,"textEqiue"):GetComponent("Text").text = "无" if EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[2]) then -- body if EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[2]).lv then Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = string.format("%d",EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[2]).lv) LingDegree = EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[2]).lv end else Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = "无" end if EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[1]) then -- body if EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[1]).lv then -- body Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = string.format("%d",EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[1]).lv) HunDegree = EquipTreasureManager.GetSingleTreasureByIdDyn(herodata.jewels[1]).lv end else Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = "无" end if herodata.star >= 6 then -- body if herodata.talismanList > 0 then -- body Util.GetGameObject(this.TextOneAll,"textFa"):GetComponent("Text").text = string.format("%d",herodata.talismanList) else Util.GetGameObject(this.TextOneAll,"textFa"):GetComponent("Text").text = string.format("无") end else Util.GetGameObject(this.TextOneAll,"textFa"):GetComponent("Text").text = string.format("无") end local data = HarmonyManager:GetAdditions() for i = 1, #data do if data[i].additionType == 1 then if HarmonyManager.hongmengTablet >= HarmonyManager.TowerStartLimit then -- body Util.GetGameObject(this.TextTwoAll,"textDegree"):GetComponent("Text").text = string.format("%d",herodata.lv) else Util.GetGameObject(this.TextTwoAll,"textDegree"):GetComponent("Text").text = string.format("%d",herodata.lv) end elseif data[i].additionType == 2 then if data[i].value == -1 then Util.GetGameObject(this.TextTwoAll,"textEqiue"):GetComponent("Text").text = string.format("无") else Util.GetGameObject(this.TextTwoAll,"textEqiue"):GetComponent("Text").text = string.format("%d",data[i].value) end -- body elseif data[i].additionType == 3 then if HunDegree ~= -1 then -- body if HunDegree >data[i].value then -- body Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = string.format("%d",HunDegree) else Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = string.format("%d",data[i].value) end else Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = "无" end -- body elseif data[i].additionType == 4 then if LingDegree ~= -1 then -- body if LingDegree>data[i].value then Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text =string.format("%d",LingDegree) else Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text =string.format("%d",data[i].value) end else Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text = "无" end -- body else if herodata.star >= 6 then -- body if data[i].value > 0 then -- body data[i].value > herodata.talismanList or data[i].value and herodata.talismanList Util.GetGameObject(this.TextTwoAll,"textFa"):GetComponent("Text").text =string.format("%d",data[i].value) else Util.GetGameObject(this.TextTwoAll,"textFa"):GetComponent("Text").text =string.format("无") end else Util.GetGameObject(this.TextTwoAll,"textFa"):GetComponent("Text").text =string.format("无") end end end end end --界面关闭时调用(用于子类重写) function GongMingResultTips:OnClose() if this.liveNode then poolManager:UnLoadLive(this.liveName, this.liveNode) this.liveNode = nil end end --界面销毁时调用(用于子类重写) function GongMingResultTips:OnDestroy() if this.liveNode then poolManager:UnLoadLive(this.liveName, this.liveNode) this.liveNode = nil end end return GongMingResultTips