2020-12-17 10:41:00 +08:00
|
|
|
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")
|
|
|
|
|
2020-12-21 10:08:30 +08:00
|
|
|
this.HeroSkin = Util.GetGameObject(self.transform,"grid/ver/HeroSkin")
|
2020-12-17 10:41:00 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--绑定事件(用于子类重写)
|
|
|
|
function GongMingResultTips:BindEvent()
|
|
|
|
|
|
|
|
Util.AddClick(this.BtnBack, function()
|
|
|
|
self:ClosePanel()
|
|
|
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--添加事件监听(用于子类重写)
|
|
|
|
function GongMingResultTips:AddListener()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--移除事件监听(用于子类重写)
|
|
|
|
function GongMingResultTips:RemoveListener()
|
|
|
|
|
|
|
|
end
|
2020-12-28 10:44:31 +08:00
|
|
|
local LingDegree = -1
|
|
|
|
local HunDegree = -1
|
2020-12-17 10:41:00 +08:00
|
|
|
function GongMingResultTips:OnOpen(flag)
|
|
|
|
|
|
|
|
--共鸣前
|
|
|
|
local SelectId = HarmonyManager:GetUnLoadData()
|
|
|
|
local herodata = HeroManager.GetSingleHeroData(SelectId)
|
|
|
|
|
2020-12-21 10:08:30 +08:00
|
|
|
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
|
2020-12-17 10:41:00 +08:00
|
|
|
|
2020-12-21 10:08:30 +08:00
|
|
|
this.liveName = GetResourcePath(heroTData.Live)
|
2020-12-25 15:33:12 +08:00
|
|
|
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)
|
2020-12-21 10:08:30 +08:00
|
|
|
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)
|
2020-12-17 10:41:00 +08:00
|
|
|
--共鸣后
|
|
|
|
if flag then
|
|
|
|
-- body
|
2020-12-18 13:39:35 +08:00
|
|
|
Util.GetGameObject(this.TextOneAll,"textDegree"):GetComponent("Text").text = string.format("%d",herodata.oriLv)
|
2020-12-17 10:41:00 +08:00
|
|
|
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)
|
2021-01-04 09:57:42 +08:00
|
|
|
if HeroManager.IsTenTalent(herodata.id) then
|
2020-12-18 13:39:35 +08:00
|
|
|
-- body
|
2020-12-28 20:02:36 +08:00
|
|
|
local data = HarmonyManager:GetAdditions()
|
|
|
|
Util.GetGameObject(this.TextTwoAll,"textDegree"):GetComponent("Text").text = data[1].value
|
2020-12-18 13:39:35 +08:00
|
|
|
else
|
|
|
|
Util.GetGameObject(this.TextTwoAll,"textDegree"):GetComponent("Text").text = herodata.lv
|
|
|
|
end
|
|
|
|
|
2020-12-17 10:41:00 +08:00
|
|
|
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("<color=green>%d</color>",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("<color=green>无</color>")
|
|
|
|
-- else
|
|
|
|
-- Util.GetGameObject(this.TextTwoAll,"textEqiue"):GetComponent("Text").text = string.format("<color=red>%d</color>",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("<color=green>%d</color>",HunDegree)
|
|
|
|
-- else
|
|
|
|
-- Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = string.format("<color=green>%d</color>",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("<color=green>%d</color>",LingDegree)
|
|
|
|
-- else
|
|
|
|
-- Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text =string.format("<color=green>%d</color>",data[i].value)
|
|
|
|
-- end
|
|
|
|
-- -- body
|
|
|
|
-- else
|
|
|
|
-- Util.GetGameObject(this.TextTwoAll,"textFa"):GetComponent("Text").text =string.format("<color=green>%d</color>",data[i].value)
|
|
|
|
-- end
|
|
|
|
-- end
|
|
|
|
|
|
|
|
else
|
2020-12-18 13:39:35 +08:00
|
|
|
|
|
|
|
Util.GetGameObject(this.TextOneAll,"textDegree"):GetComponent("Text").text = string.format("%d",herodata.oriLv)
|
2020-12-17 10:41:00 +08:00
|
|
|
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
|
2020-12-28 10:44:31 +08:00
|
|
|
else
|
|
|
|
Util.GetGameObject(this.TextOneAll,"textHun"):GetComponent("Text").text = "无"
|
2020-12-17 10:41:00 +08:00
|
|
|
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
|
2020-12-28 10:44:31 +08:00
|
|
|
else
|
|
|
|
Util.GetGameObject(this.TextOneAll,"textLing"):GetComponent("Text").text = "无"
|
2020-12-17 10:41:00 +08:00
|
|
|
end
|
2020-12-28 10:44:31 +08:00
|
|
|
if herodata.star >= 6 then
|
2020-12-26 15:58:03 +08:00
|
|
|
-- body
|
2020-12-28 10:44:31 +08:00
|
|
|
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
|
2020-12-26 15:58:03 +08:00
|
|
|
else
|
|
|
|
Util.GetGameObject(this.TextOneAll,"textFa"):GetComponent("Text").text = string.format("无")
|
|
|
|
end
|
|
|
|
|
2020-12-28 10:44:31 +08:00
|
|
|
|
2020-12-17 10:41:00 +08:00
|
|
|
|
|
|
|
local data = HarmonyManager:GetAdditions()
|
|
|
|
for i = 1, #data do
|
2020-12-18 13:39:35 +08:00
|
|
|
if data[i].additionType == 1 then
|
2020-12-23 17:41:31 +08:00
|
|
|
if HarmonyManager.hongmengTablet >= HarmonyManager.TowerStartLimit then
|
2020-12-18 13:39:35 +08:00
|
|
|
-- body
|
|
|
|
Util.GetGameObject(this.TextTwoAll,"textDegree"):GetComponent("Text").text = string.format("<color=green>%d</color>",herodata.lv)
|
|
|
|
else
|
2020-12-22 15:41:45 +08:00
|
|
|
Util.GetGameObject(this.TextTwoAll,"textDegree"):GetComponent("Text").text = string.format("<color=green>%d</color>",herodata.lv)
|
2020-12-18 13:39:35 +08:00
|
|
|
end
|
|
|
|
|
2020-12-17 10:41:00 +08:00
|
|
|
elseif data[i].additionType == 2 then
|
|
|
|
if data[i].value == -1 then
|
|
|
|
Util.GetGameObject(this.TextTwoAll,"textEqiue"):GetComponent("Text").text = string.format("<color=green>无</color>")
|
|
|
|
else
|
|
|
|
Util.GetGameObject(this.TextTwoAll,"textEqiue"):GetComponent("Text").text = string.format("<color=red>%d</color>",data[i].value)
|
|
|
|
end
|
|
|
|
-- body
|
|
|
|
elseif data[i].additionType == 3 then
|
2020-12-28 10:44:31 +08:00
|
|
|
if HunDegree ~= -1 then
|
2020-12-17 10:41:00 +08:00
|
|
|
-- body
|
2020-12-28 10:44:31 +08:00
|
|
|
if HunDegree >data[i].value then
|
|
|
|
-- body
|
|
|
|
Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = string.format("<color=green>%d</color>",HunDegree)
|
|
|
|
else
|
|
|
|
Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = string.format("<color=green>%d</color>",data[i].value)
|
|
|
|
end
|
2020-12-17 10:41:00 +08:00
|
|
|
else
|
2020-12-28 10:44:31 +08:00
|
|
|
Util.GetGameObject(this.TextTwoAll,"textHun"):GetComponent("Text").text = "<color=green>无</color>"
|
|
|
|
end
|
|
|
|
|
2020-12-17 10:41:00 +08:00
|
|
|
-- body
|
|
|
|
elseif data[i].additionType == 4 then
|
2020-12-28 10:44:31 +08:00
|
|
|
if LingDegree ~= -1 then
|
|
|
|
-- body
|
|
|
|
if LingDegree>data[i].value then
|
|
|
|
Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text =string.format("<color=green>%d</color>",LingDegree)
|
|
|
|
else
|
|
|
|
Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text =string.format("<color=green>%d</color>",data[i].value)
|
|
|
|
end
|
2020-12-17 10:41:00 +08:00
|
|
|
else
|
2020-12-28 10:44:31 +08:00
|
|
|
Util.GetGameObject(this.TextTwoAll,"textLing"):GetComponent("Text").text = "<color=green>无</color>"
|
2020-12-17 10:41:00 +08:00
|
|
|
end
|
2020-12-28 10:44:31 +08:00
|
|
|
|
2020-12-17 10:41:00 +08:00
|
|
|
-- body
|
|
|
|
else
|
2020-12-28 10:44:31 +08:00
|
|
|
if herodata.star >= 6 then
|
2020-12-26 15:58:03 +08:00
|
|
|
-- body
|
2020-12-28 10:44:31 +08:00
|
|
|
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("<color=green>%d</color>",data[i].value)
|
|
|
|
else
|
|
|
|
Util.GetGameObject(this.TextTwoAll,"textFa"):GetComponent("Text").text =string.format("<color=green>无</color>")
|
|
|
|
end
|
2020-12-26 15:58:03 +08:00
|
|
|
else
|
|
|
|
Util.GetGameObject(this.TextTwoAll,"textFa"):GetComponent("Text").text =string.format("<color=green>无</color>")
|
|
|
|
end
|
2020-12-28 10:44:31 +08:00
|
|
|
|
2020-12-26 15:58:03 +08:00
|
|
|
|
2020-12-17 10:41:00 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--界面关闭时调用(用于子类重写)
|
|
|
|
function GongMingResultTips:OnClose()
|
2020-12-25 15:33:12 +08:00
|
|
|
if this.liveNode then
|
|
|
|
poolManager:UnLoadLive(this.liveName, this.liveNode)
|
|
|
|
this.liveNode = nil
|
|
|
|
end
|
2020-12-17 10:41:00 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
--界面销毁时调用(用于子类重写)
|
|
|
|
function GongMingResultTips:OnDestroy()
|
2020-12-21 10:08:30 +08:00
|
|
|
if this.liveNode then
|
|
|
|
poolManager:UnLoadLive(this.liveName, this.liveNode)
|
|
|
|
this.liveNode = nil
|
|
|
|
end
|
2020-12-17 10:41:00 +08:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
return GongMingResultTips
|