2022-09-01 17:30:15 +08:00
|
|
|
|
require("Base/BasePanel")
|
|
|
|
|
HomeLandEquipPopup = Inherit(BasePanel)
|
2021-12-29 20:17:45 +08:00
|
|
|
|
----- --家园装备升级 -----
|
2022-09-01 17:30:15 +08:00
|
|
|
|
local this = HomeLandEquipPopup
|
2021-12-29 20:17:45 +08:00
|
|
|
|
local HomeLand = ConfigManager.GetConfig(ConfigName.HomeLand)
|
|
|
|
|
local HomeLandLevel = ConfigManager.GetConfig(ConfigName.HomeLandLevel)
|
|
|
|
|
local HomeLandTask = ConfigManager.GetConfig(ConfigName.HomeLandTask)
|
|
|
|
|
local EquipStrengthen = ConfigManager.GetConfig(ConfigName.EquipStrengthen)
|
|
|
|
|
local EquipRankUp = ConfigManager.GetConfig(ConfigName.EquipRankUp)
|
2022-01-04 18:58:34 +08:00
|
|
|
|
local ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
2021-12-29 20:17:45 +08:00
|
|
|
|
--传入父脚本模块
|
|
|
|
|
local parent
|
|
|
|
|
--传入特效层级
|
2023-04-23 15:23:41 +08:00
|
|
|
|
local orginLayer=0
|
2021-12-29 20:17:45 +08:00
|
|
|
|
local data=nil
|
|
|
|
|
local TEXT = {
|
2022-01-06 11:45:28 +08:00
|
|
|
|
[1] = {"武器","r_Equip_GuardianWeapon_0004","攻击"},
|
|
|
|
|
[2] = {"战甲","r_Equip_Coat_0005","护甲"},
|
|
|
|
|
[3] = {"头饰","r_Equip_HeadAccessory_0005","魔抗"},
|
|
|
|
|
[4] = {"战靴","r_equip_Shoes_0005","生命"},
|
2021-12-29 20:17:45 +08:00
|
|
|
|
}
|
2022-09-01 17:30:15 +08:00
|
|
|
|
local curSelectHero=nil
|
|
|
|
|
function this:InitComponent()
|
|
|
|
|
this.closeBtn=Util.GetGameObject(self.gameObject,"BG/BackBtn")
|
|
|
|
|
local gameObject=Util.GetGameObject(self.transform,"GeneralPopup_HomeLandEquip")
|
2021-12-29 20:17:45 +08:00
|
|
|
|
this.spLoader = SpriteLoader.New()
|
|
|
|
|
this.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
|
|
|
|
|
this.titleText.text="摘星阁"
|
|
|
|
|
this.Btn1 = Util.GetGameObject(gameObject,"Btn1")
|
2022-01-06 17:53:53 +08:00
|
|
|
|
this.Btn1Text = Util.GetGameObject(gameObject,"Btn1/Text"):GetComponent("Text")
|
2021-12-29 20:17:45 +08:00
|
|
|
|
this.Btn2 = Util.GetGameObject(gameObject,"Btn2")
|
2022-09-02 13:15:24 +08:00
|
|
|
|
this.resetBtn = Util.GetGameObject(gameObject,"resetBtn")
|
2021-12-30 11:00:27 +08:00
|
|
|
|
this.costCondition = Util.GetGameObject(gameObject,"Cost/Condition"):GetComponent("Text")
|
|
|
|
|
this.costIcon = Util.GetGameObject(gameObject,"Cost/Icon"):GetComponent("Image")
|
|
|
|
|
this.costNum = Util.GetGameObject(gameObject,"Cost/Num"):GetComponent("Text")
|
2022-08-08 16:13:14 +08:00
|
|
|
|
this.costIcon2 = Util.GetGameObject(gameObject,"Cost/Icon2"):GetComponent("Image")
|
|
|
|
|
this.costNum2 = Util.GetGameObject(gameObject,"Cost/Num2"):GetComponent("Text")
|
2022-01-05 18:04:57 +08:00
|
|
|
|
this.Cost = Util.GetGameObject(gameObject,"Cost")
|
|
|
|
|
this.Tips = Util.GetGameObject(gameObject,"Tips")
|
|
|
|
|
|
2021-12-29 20:17:45 +08:00
|
|
|
|
this.objList = {}
|
|
|
|
|
for i = 1, 4 do
|
|
|
|
|
this.objList[i] = {}
|
|
|
|
|
this.objList[i].Obj = Util.GetGameObject(gameObject,"Content/Grid/Pre ("..i..")")
|
|
|
|
|
this.objList[i].name = Util.GetGameObject(this.objList[i].Obj,"Name"):GetComponent("Text")
|
|
|
|
|
this.objList[i].level = Util.GetGameObject(this.objList[i].Obj,"Num"):GetComponent("Text")
|
|
|
|
|
this.objList[i].image = Util.GetGameObject(this.objList[i].Obj,"Icon"):GetComponent("Image")
|
|
|
|
|
this.objList[i].mask = Util.GetGameObject(this.objList[i].Obj,"Mask")
|
|
|
|
|
this.objList[i].select = Util.GetGameObject(this.objList[i].Obj,"Select")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
this.Desc = Util.GetGameObject(gameObject,"Content/Desc"):GetComponent("Text")
|
2022-09-01 17:30:15 +08:00
|
|
|
|
|
|
|
|
|
this.heroPre = Util.GetGameObject(this.gameObject, "Scroll/HeroPre")
|
|
|
|
|
this.scroll = Util.GetGameObject(gameObject, "Scroll")
|
|
|
|
|
this.scrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView,this.scroll.transform,
|
|
|
|
|
this.heroPre, this.scrollBar, Vector2.New(1010, 490), 1, 5, Vector2.New(20, 20))
|
|
|
|
|
this.scrollView.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(0, 0)
|
|
|
|
|
this.scrollView.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5)
|
|
|
|
|
this.scrollView.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5)
|
|
|
|
|
this.scrollView.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5)
|
|
|
|
|
this.scrollView.moveTween.MomentumAmount = 1
|
|
|
|
|
this.scrollView.moveTween.Strength = 2
|
|
|
|
|
this.heroSelect=Util.GetGameObject(this.scroll,"Select")
|
2021-12-29 20:17:45 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:BindEvent()
|
2022-09-01 17:30:15 +08:00
|
|
|
|
Util.AddClick(this.closeBtn,function()
|
|
|
|
|
self:ClosePanel()
|
|
|
|
|
end)
|
2021-12-29 20:17:45 +08:00
|
|
|
|
Util.AddClick(this.Btn1,function()
|
2022-09-01 18:34:32 +08:00
|
|
|
|
local curLv=not curSelectHero.equipStrong[HomeLandManager.curEquip] and curSelectHero.equipStrong[HomeLandManager.curEquip] or 0
|
2022-09-01 17:30:15 +08:00
|
|
|
|
local data =ConfigManager.GetConfigDataByKey(ConfigName.EquipStrengthen,"Level",curLv)
|
2021-12-29 20:17:45 +08:00
|
|
|
|
if HomeLandManager.BuildData[data.Limit[1]].level < data.Limit[2] then
|
|
|
|
|
PopupTipPanel.ShowTip(string.format("%s到达%s级可升级!",HomeLandManager.BuildData[data.Limit[1]].dataMain.Name,data.Limit[2]))
|
|
|
|
|
return
|
|
|
|
|
end
|
2022-08-08 16:13:14 +08:00
|
|
|
|
|
|
|
|
|
for i = 1, #data.Cost do
|
|
|
|
|
if BagManager.GetTotalItemNum(data.Cost[i][1]) < data.Cost[i][2] then
|
|
|
|
|
--PopupTipPanel.ShowTip(string.format("%s不足!",ItemConfig[data.Cost[i][1]].Name))
|
|
|
|
|
PopupTipPanel.ShowTip("材料不足")
|
|
|
|
|
return
|
|
|
|
|
end
|
2022-01-04 18:58:34 +08:00
|
|
|
|
end
|
2022-09-01 17:30:15 +08:00
|
|
|
|
NetManager.EquipIntensifyRequset(curSelectHero.dynamicId,HomeLandManager.curEquip,function ()
|
2021-12-29 20:17:45 +08:00
|
|
|
|
this:Refresh()
|
|
|
|
|
end)
|
|
|
|
|
end)
|
|
|
|
|
Util.AddClick(this.Btn2,function()
|
2022-09-01 17:30:15 +08:00
|
|
|
|
if HomeLandManager.GetAllCanUpgradeWithPopup(curSelectHero) then
|
2021-12-29 20:17:45 +08:00
|
|
|
|
this:Refresh()
|
|
|
|
|
return
|
|
|
|
|
end
|
2022-09-01 17:30:15 +08:00
|
|
|
|
NetManager.EquipIntensifyRequset(curSelectHero.dynamicId,0,function ()
|
2021-12-29 20:17:45 +08:00
|
|
|
|
this:Refresh()
|
|
|
|
|
end)
|
|
|
|
|
end)
|
2022-09-02 13:15:24 +08:00
|
|
|
|
Util.AddClick(this.resetBtn,function()
|
|
|
|
|
NetManager.ResetHeroEquipRequest(curSelectHero.dynamicId,function ()
|
|
|
|
|
this:Refresh()
|
|
|
|
|
end)
|
|
|
|
|
end)
|
2021-12-29 20:17:45 +08:00
|
|
|
|
end
|
|
|
|
|
|
2023-04-23 15:23:41 +08:00
|
|
|
|
function this:OnSortingOrderChange()
|
|
|
|
|
orginLayer = self.sortingOrder
|
|
|
|
|
end
|
|
|
|
|
|
2021-12-29 20:17:45 +08:00
|
|
|
|
function this:AddListener()
|
2022-01-04 18:58:34 +08:00
|
|
|
|
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, this.SetData)
|
2021-12-29 20:17:45 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:RemoveListener()
|
2022-01-04 18:58:34 +08:00
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold, this.SetData)
|
2021-12-29 20:17:45 +08:00
|
|
|
|
end
|
|
|
|
|
|
2022-09-01 17:30:15 +08:00
|
|
|
|
function this:OnOpen()
|
|
|
|
|
local _roleDatas = HeroManager.GetAllHeroDatas()
|
|
|
|
|
this.SetHeroList(_roleDatas)
|
2022-09-02 14:40:36 +08:00
|
|
|
|
curSelectHero=_roleDatas[1]
|
2021-12-29 20:17:45 +08:00
|
|
|
|
this:Refresh()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:Refresh()
|
|
|
|
|
for i = 1, 4 do
|
|
|
|
|
local go = this.objList[i]
|
|
|
|
|
go.select:SetActive(i == HomeLandManager.curEquip)
|
|
|
|
|
go.name.text = TEXT[i][1].."加持"
|
2022-09-01 17:30:15 +08:00
|
|
|
|
go.level.text = curSelectHero.equipStrong[i]~=nil and curSelectHero.equipStrong[i] or 0
|
2021-12-29 20:17:45 +08:00
|
|
|
|
go.image.sprite = this.spLoader:LoadSprite(TEXT[i][2])
|
|
|
|
|
Util.AddOnceClick(go.mask,function ()
|
|
|
|
|
HomeLandManager.curEquip = i
|
|
|
|
|
this:Refresh()
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
2021-12-30 11:00:27 +08:00
|
|
|
|
--显示加持属性
|
2021-12-29 20:17:45 +08:00
|
|
|
|
this:SetData()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:SetData()
|
|
|
|
|
-- LogPink(HomeLandManager.EquipData[HomeLandManager.curEquip].Id)
|
|
|
|
|
local curIndex = HomeLandManager.curEquip
|
2022-09-01 17:30:15 +08:00
|
|
|
|
local curLv=0
|
|
|
|
|
if curSelectHero.equipStrong[curIndex] then
|
|
|
|
|
curLv=curSelectHero.equipStrong[curIndex]
|
|
|
|
|
end
|
|
|
|
|
local equipStrengthenConfig=ConfigManager.GetConfigDataByKey(ConfigName.EquipStrengthen,"Level",curLv)
|
|
|
|
|
local equipRankUpConfig=ConfigManager.GetConfigDataByKey(ConfigName.EquipRankUp,"Level",curSelectHero.equipAdvanceLv)
|
2021-12-30 11:00:27 +08:00
|
|
|
|
--设置消耗
|
2022-09-01 17:30:15 +08:00
|
|
|
|
local limit = equipStrengthenConfig.Limit
|
|
|
|
|
local cost = equipStrengthenConfig.Cost
|
|
|
|
|
local data = equipStrengthenConfig.Rate--当前装备加成
|
|
|
|
|
local proData = equipRankUpConfig.Rate--当前装备突破加成
|
2022-01-05 18:04:57 +08:00
|
|
|
|
|
2022-01-06 17:53:53 +08:00
|
|
|
|
if cost then--如果有下一级
|
2022-09-01 17:30:15 +08:00
|
|
|
|
local nextEquipStrengthenConfig=ConfigManager.GetConfigDataByKey(ConfigName.EquipStrengthen,"Level",curLv+1)
|
|
|
|
|
local nextData = nextEquipStrengthenConfig.Rate--下一装备加成
|
|
|
|
|
local nextProData = EquipRankUp[equipRankUpConfig.id + 1].Rate--下一装备突破加成
|
2022-01-06 17:53:53 +08:00
|
|
|
|
|
|
|
|
|
local num1 = data + proData[curIndex]
|
|
|
|
|
local num2 = 0
|
2022-09-01 17:30:15 +08:00
|
|
|
|
if not equipStrengthenConfig.Limit2==equipRankUpConfig.Level then--如果都到达了等级上限
|
2022-01-06 17:53:53 +08:00
|
|
|
|
num2 = data + nextProData[curIndex]
|
|
|
|
|
else
|
|
|
|
|
num2 = nextData + proData[curIndex]
|
|
|
|
|
end
|
2022-04-07 11:45:51 +08:00
|
|
|
|
this.Desc.text = string.format("神将佩戴的%s%s属性增加%s",TEXT[curIndex][1],TEXT[curIndex][3],num1/100).."%"..string.format("<color=#00FF00>(%s",num2/100).."%)</color>"
|
2022-01-06 17:53:53 +08:00
|
|
|
|
|
|
|
|
|
this.Btn1Text.text = "强 化"
|
|
|
|
|
Util.SetGray(this.Btn1,false)
|
|
|
|
|
this.Btn1:GetComponent("Button").enabled = true
|
2022-08-08 16:13:14 +08:00
|
|
|
|
|
2022-01-06 17:53:53 +08:00
|
|
|
|
if HomeLandManager.BuildData[limit[1]].level >= limit[2] then
|
2022-09-02 14:26:03 +08:00
|
|
|
|
this.costCondition.text = "强化消耗:"
|
2022-01-06 17:53:53 +08:00
|
|
|
|
this.costIcon.gameObject:SetActive(true)
|
|
|
|
|
this.costNum.gameObject:SetActive(true)
|
2022-08-09 13:42:59 +08:00
|
|
|
|
|
2022-08-08 16:13:14 +08:00
|
|
|
|
this.costIcon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(cost[1][1]))
|
2022-01-06 17:53:53 +08:00
|
|
|
|
local color2 = BagManager.GetTotalItemNum(cost[1][1]) >= cost[1][2] and "#FFEED6" or "red"
|
|
|
|
|
this.costNum.text = string.format("<color=%s>%s</color>",color2,cost[1][2])
|
2022-08-09 13:42:59 +08:00
|
|
|
|
LogError("cost len=="..#cost)
|
|
|
|
|
if #cost>1 then
|
2022-08-08 16:13:14 +08:00
|
|
|
|
this.costIcon2.gameObject:SetActive(true)
|
|
|
|
|
this.costNum2.gameObject:SetActive(true)
|
|
|
|
|
this.costIcon2.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(cost[2][1]))
|
|
|
|
|
local color3 = BagManager.GetTotalItemNum(cost[2][1]) >= cost[2][2] and "#FFEED6" or "red"
|
|
|
|
|
this.costNum2.text = string.format("<color=%s>%s</color>",color3,cost[2][2])
|
2022-08-09 13:42:59 +08:00
|
|
|
|
else
|
|
|
|
|
this.costIcon2.gameObject:SetActive(false)
|
|
|
|
|
this.costNum2.gameObject:SetActive(false)
|
2022-08-08 16:13:14 +08:00
|
|
|
|
end
|
2022-01-06 17:53:53 +08:00
|
|
|
|
else
|
|
|
|
|
this.costIcon.gameObject:SetActive(false)
|
|
|
|
|
this.costNum.gameObject:SetActive(false)
|
2022-08-08 16:13:14 +08:00
|
|
|
|
this.costIcon2.gameObject:SetActive(false)
|
|
|
|
|
this.costNum2.gameObject:SetActive(false)
|
2022-01-06 17:53:53 +08:00
|
|
|
|
this.costCondition.text = string.format("<color=red>%s需要到达%s级</color>",HomeLand[limit[1]].Name,limit[2])
|
|
|
|
|
end
|
|
|
|
|
--按钮和tips显示
|
2022-09-01 17:30:15 +08:00
|
|
|
|
local bool = equipStrengthenConfig.Limit2==equipRankUpConfig.Level
|
2022-01-06 17:53:53 +08:00
|
|
|
|
-- LogBlue("bool:"..tostring(bool))
|
|
|
|
|
this.Btn1:SetActive(bool)
|
|
|
|
|
this.Btn2:SetActive(not bool)
|
|
|
|
|
--不同显示
|
|
|
|
|
this.Cost:SetActive(bool)
|
|
|
|
|
this.Tips:SetActive(not bool)
|
|
|
|
|
this.costCondition.gameObject:SetActive(true)
|
2022-09-01 17:30:15 +08:00
|
|
|
|
this.Tips:GetComponent("Text").text = string.format("全部加持到达%s级后方可进行突破",equipStrengthenConfig.Level)
|
|
|
|
|
if not bool and HomeLandManager.GetAllCanUpgrade(curSelectHero) then
|
2022-01-06 17:53:53 +08:00
|
|
|
|
this.Cost:SetActive(true)
|
|
|
|
|
this.Tips:SetActive(false)
|
|
|
|
|
this.costIcon.gameObject:SetActive(true)
|
|
|
|
|
this.costNum.gameObject:SetActive(true)
|
2022-09-02 14:26:03 +08:00
|
|
|
|
-- this.costCondition.gameObject:SetActive(false)
|
|
|
|
|
this.costCondition.text = "突破消耗:"
|
2022-01-06 17:53:53 +08:00
|
|
|
|
--突破的消耗和升级不同
|
2022-09-01 17:30:15 +08:00
|
|
|
|
local cost = equipRankUpConfig.Cost
|
2022-08-09 13:42:59 +08:00
|
|
|
|
local color2 = BagManager.GetTotalItemNum(cost[1][1]) >= cost[1][2] and "#FFEED6" or "red"
|
|
|
|
|
this.costIcon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(cost[1][1]))
|
|
|
|
|
this.costNum.text = string.format("<color=%s>%s</color>",color2,cost[1][2])
|
|
|
|
|
if cost[2] then
|
|
|
|
|
this.costIcon2.gameObject:SetActive(true)
|
|
|
|
|
this.costNum2.gameObject:SetActive(true)
|
|
|
|
|
this.costIcon2.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(cost[2][1]))
|
|
|
|
|
local color3 = BagManager.GetTotalItemNum(cost[2][1]) >= cost[2][2] and "#FFEED6" or "red"
|
|
|
|
|
this.costNum2.text = string.format("<color=%s>%s</color>",color3,cost[2][2])
|
|
|
|
|
else
|
|
|
|
|
this.costIcon2.gameObject:SetActive(false)
|
|
|
|
|
this.costNum2.gameObject:SetActive(false)
|
|
|
|
|
end
|
2022-01-06 17:53:53 +08:00
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
this.Btn1:SetActive(true)
|
|
|
|
|
this.Btn2:SetActive(false)
|
|
|
|
|
this.Btn1Text.text = "已达上限"
|
|
|
|
|
Util.SetGray(this.Btn1,true)
|
|
|
|
|
this.Btn1:GetComponent("Button").enabled = false
|
|
|
|
|
local num1 = data + proData[curIndex]
|
|
|
|
|
this.Desc.text = string.format("神将佩戴的%s%s属性增加%s",TEXT[curIndex][1],TEXT[curIndex][3],num1).."%"
|
|
|
|
|
this.Cost:SetActive(false)
|
2022-01-06 11:45:28 +08:00
|
|
|
|
this.Tips:SetActive(false)
|
2022-01-05 18:04:57 +08:00
|
|
|
|
end
|
2021-12-29 20:17:45 +08:00
|
|
|
|
end
|
2022-09-01 17:30:15 +08:00
|
|
|
|
---设置显示英雄列表
|
|
|
|
|
function this.SetHeroList(_roleDatas)
|
2022-09-01 17:52:21 +08:00
|
|
|
|
HeroManager.SortHeroDatas(_roleDatas)
|
2022-09-01 17:30:15 +08:00
|
|
|
|
this.scrollView:SetData(_roleDatas, function(index, go)
|
|
|
|
|
if index==1 then
|
|
|
|
|
this.SetHeroSelect(go)
|
|
|
|
|
end
|
|
|
|
|
-- 基础显示
|
|
|
|
|
this.SingleHeroDataShow(go, _roleDatas[index])
|
|
|
|
|
end, true,false)
|
|
|
|
|
end
|
|
|
|
|
|
2022-09-01 17:52:21 +08:00
|
|
|
|
--英雄排序
|
|
|
|
|
function this:SortHeroDatas(_heroDatas)
|
|
|
|
|
--上阵最优先,星级优先,同星级等级优先,同星级同等级按sortId排序。排序时降序排序。
|
|
|
|
|
table.sort(_heroDatas, function(a, b)
|
|
|
|
|
if a.star == b.star then
|
|
|
|
|
if a.heroConfig.Natural ==b.heroConfig.Natural then
|
|
|
|
|
if a.lv == b.lv then
|
|
|
|
|
return a.heroConfig.Id < b.heroConfig.Id
|
|
|
|
|
else
|
|
|
|
|
return a.lv > b.lv
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
return a.heroConfig.Natural > b.heroConfig.Natural
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
return a.star > b.star
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
2022-09-01 17:30:15 +08:00
|
|
|
|
--设置每条英雄数据
|
|
|
|
|
function this.SingleHeroDataShow(_go, _heroData)
|
|
|
|
|
local go=_go
|
|
|
|
|
local heroData=_heroData
|
|
|
|
|
local frame=Util.GetGameObject(go,"frame"):GetComponent("Image")
|
|
|
|
|
local icon=Util.GetGameObject(go, "icon"):GetComponent("Image")
|
|
|
|
|
local lv= Util.GetGameObject(go, "lv/Text"):GetComponent("Text")
|
|
|
|
|
local pro= Util.GetGameObject(go, "proIcon"):GetComponent("Image")
|
|
|
|
|
local pos= Util.GetGameObject(go, "posIcon"):GetComponent("Image")
|
|
|
|
|
local teamList={}
|
|
|
|
|
for i = 1, 3 do
|
|
|
|
|
table.insert(teamList,Util.GetGameObject(go, "yxteamName/Image"..i))
|
|
|
|
|
end
|
|
|
|
|
local yxInfo=Util.GetGameObject(go, "yxteamName")
|
|
|
|
|
--local yxTeamName=Util.GetGameObject(go, "yxteamName/Text"):GetComponent("Text")
|
|
|
|
|
yxInfo:SetActive(false)
|
|
|
|
|
Util.GetGameObject(go, "posIcon"):SetActive(this.curFormationIndex == FormationTypeDef.FIGHT_LEVEL or this.curFormationIndex == FormationTypeDef.FIGHT_ASSISTANTLEVEL or
|
|
|
|
|
this.curFormationIndex == FormationTypeDef.FORMATION_QIJIESHILIAN)
|
|
|
|
|
local starGrid = Util.GetGameObject(go, "star")
|
|
|
|
|
local yuanImage = Util.GetGameObject(go, "yuanImage")
|
|
|
|
|
yuanImage.gameObject:SetActive(false)
|
|
|
|
|
local choosedObj = Util.GetGameObject(go, "choosed")
|
|
|
|
|
choosedObj.gameObject:SetActive(false)
|
|
|
|
|
local hpExp = Util.GetGameObject(go, "hpExp")
|
|
|
|
|
hpExp.gameObject:SetActive(false)
|
|
|
|
|
local redPot = Util.GetGameObject(go, "redpoint")
|
|
|
|
|
local changeProBtn=Util.GetGameObject(go,"proMaskObj")
|
|
|
|
|
if heroData.isNew and heroData.isNew == 1 then
|
|
|
|
|
redPot.gameObject:SetActive(true)
|
|
|
|
|
else
|
|
|
|
|
redPot.gameObject:SetActive(false)
|
|
|
|
|
end
|
2023-04-23 15:23:41 +08:00
|
|
|
|
--if _heroData.property then
|
|
|
|
|
--changeProBtn:SetActive(_heroData.property>=5)
|
|
|
|
|
--pro.sprite= this.spLoader:LoadSprite(GetProStrImageByProNum(heroData.property))
|
|
|
|
|
--else
|
2022-09-01 17:30:15 +08:00
|
|
|
|
changeProBtn:SetActive(false)
|
|
|
|
|
pro.sprite= this.spLoader:LoadSprite(GetProStrImageByProNum(heroData.heroConfig.PropertyName))
|
2023-04-23 15:23:41 +08:00
|
|
|
|
--end
|
2022-09-01 17:30:15 +08:00
|
|
|
|
frame.sprite=this.spLoader:LoadSprite(GetHeroQuantityImageByquality(heroData.heroConfig.Quality,heroData.star))
|
|
|
|
|
icon.sprite=this.spLoader:LoadSprite(heroData.icon)
|
|
|
|
|
if HarmonyManager.IsChangeColor(heroData.dynamicId) then
|
|
|
|
|
-- body
|
|
|
|
|
lv.text="<color=#0f0>"..heroData.lv.."</color>"
|
|
|
|
|
elseif HarmonyManager:IsEnvoy(heroData.dynamicId) and HarmonyManager:HongMengTowerUpLimit() >= HarmonyManager.TowerStartLimit then
|
|
|
|
|
-- bod
|
|
|
|
|
lv.text="<color=#ffbe22>"..heroData.lv.."</color>"
|
|
|
|
|
else
|
|
|
|
|
lv.text=heroData.lv
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pos.sprite = this.spLoader:LoadSprite(heroData.professionIcon)
|
|
|
|
|
local star,starType = heroData.GetStar(1)
|
|
|
|
|
local starSize = Vector2.New(30,30)
|
|
|
|
|
local starScale = -8
|
|
|
|
|
if starType == 3 then
|
|
|
|
|
starSize = Vector2.New(1,-15.65)
|
|
|
|
|
starScale = -13
|
|
|
|
|
elseif starType == 2 then
|
|
|
|
|
starSize = Vector2.New(60,57)
|
|
|
|
|
end
|
|
|
|
|
SetHeroStars(this.spLoader, starGrid, star,starType,starSize,starScale)
|
2023-04-23 15:23:41 +08:00
|
|
|
|
SetParticleSortLayer(go,orginLayer+1)
|
2022-09-01 17:30:15 +08:00
|
|
|
|
Util.AddOnceClick(go, function()
|
|
|
|
|
curSelectHero=_heroData
|
2022-09-01 17:52:21 +08:00
|
|
|
|
this:Refresh()
|
2022-09-01 17:30:15 +08:00
|
|
|
|
this.SetHeroSelect(go)
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this.SetHeroSelect(_heroObj)
|
|
|
|
|
this.heroSelect.transform:SetParent(_heroObj.transform)
|
|
|
|
|
this.heroSelect.transform.localPosition=Vector3.zero
|
|
|
|
|
end
|
2021-12-29 20:17:45 +08:00
|
|
|
|
|
|
|
|
|
function this:OnClose()
|
|
|
|
|
HomeLandManager.curEquip = 1
|
|
|
|
|
data=nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this:OnDestroy()
|
|
|
|
|
this.SelectList = {}
|
|
|
|
|
this.spLoader:Destroy()
|
2022-09-01 17:30:15 +08:00
|
|
|
|
this.scrollView = nil
|
2021-12-29 20:17:45 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return this
|