miduo_client/Assets/ManagedResources/~Lua/Modules/CompoundHero/view/CompoundHero_Replace.lua

471 lines
18 KiB
Lua
Raw Normal View History

2020-08-25 15:46:38 +08:00
----- 神将置换 -----
2020-08-05 16:30:02 +08:00
local this = {}
local sortingOrder=0
2020-08-11 20:55:05 +08:00
local tabs={}
local curIndex = 0
local curSelectHero = {}
local curSelectHeroConfig = {}
local heroSelectBtn = {}
local heroDatas
local t
local replaceItemIdConfig = ConfigManager.GetConfigData(ConfigName.SpecialConfig,68)
local replaceCostConfig = ConfigManager.GetConfigData(ConfigName.SpecialConfig,69)
2020-08-11 20:55:05 +08:00
local HeroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig)
2020-08-05 16:30:02 +08:00
function this:InitComponent(gameObject)
2021-04-21 13:12:04 +08:00
this.spLoader = SpriteLoader.New()
2020-08-11 20:55:05 +08:00
this.gameObject = gameObject
this.heroPre = Util.GetGameObject(gameObject, "CompoundHeroPanel_Replace/item")
this.replaceBtn = Util.GetGameObject(gameObject, "CompoundHeroPanel_Replace/btns/replaceBtn")
this.saveBtn = Util.GetGameObject(gameObject, "CompoundHeroPanel_Replace/btns/saveBtn")
this.cancelBtn = Util.GetGameObject(gameObject, "CompoundHeroPanel_Replace/btns/cancelBtn")
2023-04-21 14:18:03 +08:00
for i = 1, 6 do
2020-08-11 20:55:05 +08:00
tabs[i] = Util.GetGameObject(gameObject, "CompoundHeroPanel_Replace/Tabs/Grid/Btn" .. i)
end
this.selectBtn=Util.GetGameObject(gameObject, "CompoundHeroPanel_Replace/Tabs/SelectBtn")
this.selectBtn:SetActive(true)
this.ScrollBar=Util.GetGameObject(gameObject, "CompoundHeroPanel_Replace/Scrollbar"):GetComponent("Scrollbar")
local v2 = Util.GetGameObject(gameObject, "CompoundHeroPanel_Replace/scroll"):GetComponent("RectTransform").rect
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, Util.GetGameObject(gameObject, "CompoundHeroPanel_Replace/scroll").transform,
2020-09-02 18:07:20 +08:00
this.heroPre, this.ScrollBar, Vector2.New(-v2.x*2, -v2.y*2), 1, 5, Vector2.New(35,15))
2020-08-11 20:55:05 +08:00
this.ScrollView.moveTween.MomentumAmount = 1
this.ScrollView.moveTween.Strength = 1
--need -> replaceHero Info
this.needHero = Util.GetGameObject(gameObject, "CompoundHeroPanel_Replace/heros/needHero")
this.replaceHero = Util.GetGameObject(gameObject, "CompoundHeroPanel_Replace/heros/replacedHero")
2020-08-05 16:30:02 +08:00
2020-08-12 14:13:16 +08:00
this.needBg = Util.GetGameObject(gameObject, "CompoundHeroPanel_Replace/bg/heroPlace1")
this.replaceBg = Util.GetGameObject(gameObject, "CompoundHeroPanel_Replace/bg/heroPlace2")
this.text = Util.GetGameObject(gameObject, "CompoundHeroPanel_Replace/heros/content/Text")
this.cost = Util.GetGameObject(gameObject, "CompoundHeroPanel_Replace/heros/content/cost")
2020-08-13 12:00:18 +08:00
this.costImage = Util.GetGameObject(this.cost, "Image"):GetComponent("Image")
2020-08-12 20:59:20 +08:00
this.costText = Util.GetGameObject(this.cost,"Text"):GetComponent("Text")
2020-08-12 14:13:16 +08:00
2020-08-05 16:30:02 +08:00
end
function this:BindEvent()
2020-08-11 20:55:05 +08:00
--置换
Util.AddClick(this.replaceBtn,function()
if not curSelectHero.id then
2021-04-09 12:26:35 +08:00
PopupTipPanel.ShowTip(Language[10417])
elseif curSelectHero.id and (t>BagManager.GetTotalItemNum(tonumber(replaceItemIdConfig.Value))) then
2021-04-09 12:26:35 +08:00
PopupTipPanel.ShowTip(Language[10418])
else
2020-08-11 20:55:05 +08:00
NetManager.SaveHeroChangeRequest(curSelectHero.dynamicId,function (msg)
HeroManager.ResetHeroChangeId(curSelectHero.dynamicId,msg.heroTempId)--改变英雄changeId
this.replaceHero:SetActive(true)
this.cancelBtn:SetActive(true)
this.replaceBtn:SetActive(false)
this.saveBtn:SetActive(true)
2020-08-12 14:13:16 +08:00
this.needBg:SetActive(false)
this.replaceBg:SetActive(false)
this.text:SetActive(false)
this.cost:SetActive(false)
2020-08-13 16:38:40 +08:00
this.ShowCostInfo()
2020-08-13 12:00:18 +08:00
local value = this.RebuildData(msg.heroTempId,curSelectHero)
2020-08-11 20:55:05 +08:00
this.SetHero(this.replaceHero,value)
end)
end
end)
--取消
Util.AddClick(this.cancelBtn,function()
NetManager.CancelHeroChangeRequest(curSelectHero.dynamicId,function (msg)
HeroManager.ResetHeroChangeId(curSelectHero.dynamicId)--改变英雄changeId
this.replaceHero:SetActive(false)
2020-08-13 12:00:18 +08:00
this.needHero:SetActive(true)
2020-08-11 20:55:05 +08:00
this.cancelBtn:SetActive(false)
this.replaceBtn:SetActive(true)
this.saveBtn:SetActive(false)
2020-08-13 12:00:18 +08:00
this.needBg:SetActive(false)
2020-08-12 14:13:16 +08:00
this.replaceBg:SetActive(true)
2020-08-13 12:33:21 +08:00
this.text:SetActive(false)
this.cost:SetActive(true)
2020-08-13 16:38:40 +08:00
this.ShowCostInfo()
2020-08-11 20:55:05 +08:00
end)
end)
--保存置换
Util.AddClick(this.saveBtn,function()
NetManager.DoHeroChangeRequest(curSelectHero.dynamicId,function (msg)
this.replaceHero:SetActive(false)
this.needHero:SetActive(false)
2020-08-12 14:13:16 +08:00
this.needBg:SetActive(true)
this.replaceBg:SetActive(true)
this.text:SetActive(true)
this.cost:SetActive(false)
2020-08-13 16:38:40 +08:00
this.ShowCostInfo()
2020-08-11 20:55:05 +08:00
HeroManager.DeleteHeroDatas({curSelectHero.dynamicId})
2020-08-13 12:00:18 +08:00
for i = 1, #msg.drop.Hero do
HeroManager.UpdateHeroDatas(msg.drop.Hero[i])
ExpeditionManager.InitHeroHpValue(msg.drop.Hero[i].id)
2020-08-13 12:00:18 +08:00
end
CheckRedPointStatus(RedPointType.Huaxutan_CompoundHero)
2020-08-13 12:00:18 +08:00
curSelectHero = HeroManager.GetSingleHeroData(msg.drop.Hero[1].id)
this.ShowCurrPosHeroReplace(curIndex)
2020-08-11 20:55:05 +08:00
end)
end)
end
2020-08-05 16:30:02 +08:00
2020-08-11 20:55:05 +08:00
--通过Id 重新组成数据
2020-08-13 12:00:18 +08:00
function this.RebuildData(id,curHero)
2020-08-11 20:55:05 +08:00
local herodata = {}
herodata.id = HeroConfig[id].Id
2021-01-26 17:08:39 +08:00
herodata.name = GetLanguageStrById(HeroConfig[id].ReadingName)
2024-01-13 15:45:40 +08:00
herodata.live = GetResourcePath(HeroConfig[id].Painting)
2020-08-11 20:55:05 +08:00
herodata.star = HeroConfig[id].Star
2020-08-13 12:00:18 +08:00
herodata.lv = curHero.lv
2020-08-11 20:55:05 +08:00
herodata.quality = HeroConfig[id].Quality
herodata.profession = HeroConfig[id].Profession
herodata.scale = HeroConfig[id].Scale
herodata.position = HeroConfig[id].Position
herodata.property = HeroConfig[id].PropertyName
return herodata
2020-08-05 16:30:02 +08:00
end
function this:AddListener()
end
function this:RemoveListener()
end
function this:OnSortingOrderChange(_sortingOrder)
sortingOrder = _sortingOrder
end
function this:OnShow(...)
2020-08-11 20:55:05 +08:00
curIndex = 0
sortingOrder =0
for i = 0,#tabs - 1 do
local index=i
2021-04-21 13:12:04 +08:00
Util.GetGameObject(tabs[i + 1], "Image"):GetComponent("Image").sprite=this.spLoader:LoadSprite(GetProStrImageByProNum(index))
2023-11-01 15:46:54 +08:00
Util.GetGameObject(tabs[i + 1], "Image/Text"):GetComponent("Text").text=PropertyType[index]
2020-08-11 20:55:05 +08:00
Util.AddOnceClick(tabs[i + 1], function()
curSelectHero = {}
if index == curIndex then
curIndex=0
this.HeroReplaceBtnClick(tabs[1],curIndex)
else
this.HeroReplaceBtnClick(tabs[i + 1],index)
end
end)
end
this.HeroReplaceBtnClick(tabs[1],curIndex)
end
--英雄类型按钮点击事件
function this.HeroReplaceBtnClick(_btn,_curIndex)
curIndex = _curIndex
this.needBg:SetActive(true)
this.replaceBg:SetActive(true)
2020-08-11 20:55:05 +08:00
this.SetBtnSelect(_btn)
this.ShowCurrPosHeroReplace(_curIndex)
end
--显示当前阵营的英雄
function this.ShowCurrPosHeroReplace(_curIndex)
this.replaceHero:SetActive(false)
this.needHero:SetActive(false)
heroDatas = this.GetHeroDataByPosition(_curIndex)
this.ScrollView:SetData(heroDatas, function (index, go)
2020-08-13 16:38:40 +08:00
-- heroSelectBtn[index] = Util.GetGameObject(go.transform, "choosed")
-- if not heroSelectBtn[heroDatas[index].dynamicId] then
-- heroSelectBtn[heroDatas[index].dynamicId] = Util.GetGameObject(go.transform, "choosed")
-- end
2020-08-11 20:55:05 +08:00
this.SingleHeroDataShow(go, heroDatas[index])
end)
-- this.ScrollView:ForeachItemGO(function(index, go)
-- Timer.New(function()
-- go.gameObject:SetActive(true)
-- PlayUIAnim(go.gameObject)
-- end, 0.001 * (index - 1)):Start()
-- end)
2020-08-11 20:55:05 +08:00
end
--通过职业筛选英雄
function this.GetHeroDataByPosition(_position)
local heros = {}
local index = 1
for i, v in pairs(HeroManager.ByReplaceHeroGetAllHeros()) do
--这里不显示神系的武将
if v.heroConfig.PropertyName == _position or (_position ==0 and v.heroConfig.PropertyName~=5 ) then --0 全职业
2020-08-11 20:55:05 +08:00
heros[index] = v
index = index + 1
end
end
return heros
end
2020-08-13 16:38:40 +08:00
local oldChoose
2020-08-11 20:55:05 +08:00
--数据显示
function this.SingleHeroDataShow(_go,_heroData)
local go = _go
local heroData = _heroData
2021-04-21 13:12:04 +08:00
Util.GetGameObject(go.transform, "frame"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetHeroQuantityImageByquality(HeroConfig[heroData.id].Quality,heroData.star))
2020-08-11 20:55:05 +08:00
Util.GetGameObject(go.transform, "lv/Text"):GetComponent("Text").text = heroData.lv
2021-04-21 13:12:04 +08:00
Util.GetGameObject(go.transform, "icon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(heroData.icon)
2020-08-11 20:55:05 +08:00
Util.GetGameObject(go.transform, "posIcon"):SetActive(false)
Util.GetGameObject(go.transform, "proIcon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetProStrImageByProNum(heroData.changeProId))
2021-01-26 17:08:39 +08:00
Util.GetGameObject(go.transform, "Text"):GetComponent("Text").text = SubString2(GetLanguageStrById(heroData.name),8 )
2020-08-13 12:00:18 +08:00
2020-08-12 14:13:16 +08:00
local formationMask = Util.GetGameObject(go.transform, "formationMask")
local formationImage = Util.GetGameObject(go.transform, "formationMask/formationImage/upImage"):GetComponent("Image")
2020-08-27 22:23:04 +08:00
if LengthOfTable(heroData.formationList) ~= 0 then
--if LengthOfTable(heroData.formationList) ~= 0 then
2020-08-12 14:13:16 +08:00
formationMask:SetActive(true)
2021-04-21 13:12:04 +08:00
formationImage.sprite = this.spLoader:LoadSprite("t_tongyong-yishangzheng_zh")
2020-08-12 14:13:16 +08:00
elseif heroData.lockState == 1 then
formationMask:SetActive(true)
2021-04-21 13:12:04 +08:00
formationImage.sprite = this.spLoader:LoadSprite("r_hero_suodi_yisuoding_zh")
2020-08-12 14:13:16 +08:00
else
formationMask:SetActive(false)
end
2020-08-13 12:00:18 +08:00
2020-08-11 20:55:05 +08:00
local starGrid = Util.GetGameObject(go.transform, "star")
2021-10-26 16:00:31 +08:00
local star,starType = heroData.GetStar(1)
SetHeroStars(this.spLoader, starGrid, star,starType,nil,nil,Vector2.New(0,1))
2020-08-11 20:55:05 +08:00
local cardBtn = Util.GetGameObject(go.transform, "icon")
local choosed = Util.GetGameObject(go.transform, "choosed")
2020-12-18 16:37:56 +08:00
local GongMingMask = Util.GetGameObject(go.transform, "GongMingMask")
GongMingMask:SetActive(false)--最后检测是否共鸣
if heroData.lockState == 1 or LengthOfTable(heroData.formationList) ~= 0 then
else
if HarmonyManager.IsChangeColor(heroData.dynamicId) then
Util.GetGameObject(go.transform, "lv/Text"):GetComponent("Text").text = "<color=#0f0>"..heroData.lv.."</color>"
GongMingMask:SetActive(true)
2021-01-25 17:04:54 +08:00
elseif HarmonyManager:IsEnvoy(heroData.dynamicId) and HarmonyManager:HongMengTowerUpLimit() ~= 0 then
2020-12-18 16:37:56 +08:00
Util.GetGameObject(go.transform, "lv/Text"):GetComponent("Text").text = "<color=#ffbe22>"..heroData.lv.."</color>"
GongMingMask:SetActive(true)
end
end
2020-08-11 20:55:05 +08:00
choosed:SetActive(false)
2020-08-13 16:38:40 +08:00
if curSelectHero.dynamicId == heroData.dynamicId then
choosed:SetActive(true)
oldChoose = choosed
end
2020-08-11 20:55:05 +08:00
this.replaceBtn:SetActive(true)
this.cancelBtn:SetActive(false)
this.saveBtn:SetActive(false)
2020-08-12 14:13:16 +08:00
this.needBg:SetActive(true)
this.replaceBg:SetActive(true)
this.text:SetActive(true)
this.cost:SetActive(false)
2020-08-11 20:55:05 +08:00
2020-08-13 12:00:18 +08:00
if curSelectHero.id then
this.SetHero(this.needHero,curSelectHero)
this.ShowCostInfo()
this.needHero:SetActive(true)
this.replaceHero:SetActive(false)
this.needBg:SetActive(false)
this.replaceBg:SetActive(true)
this.text:SetActive(false)
this.cost:SetActive(true)
end
2020-12-18 16:37:56 +08:00
Util.AddOnceClick(GongMingMask, function()
2021-04-09 12:26:35 +08:00
PopupTipPanel.ShowTip(Language[12184])
2020-12-18 16:37:56 +08:00
end)
2020-08-11 20:55:05 +08:00
Util.AddOnceClick(cardBtn, function()
if heroData.dynamicId == curSelectHero.dynamicId then
choosed:SetActive(false)
2020-08-13 16:38:40 +08:00
oldChoose = nil
2020-08-11 20:55:05 +08:00
curSelectHero = {}
this.needHero:SetActive(false)
this.replaceHero:SetActive(false)
this.cancelBtn:SetActive(false)
this.saveBtn:SetActive(false)
this.replaceBtn:SetActive(true)
2020-08-12 14:13:16 +08:00
this.needBg:SetActive(true)
this.replaceBg:SetActive(true)
this.text:SetActive(true)
this.cost:SetActive(false)
2020-08-11 20:55:05 +08:00
else
choosed:SetActive(true)
2020-08-13 16:38:40 +08:00
if oldChoose then
oldChoose:SetActive(false)
end
oldChoose = choosed
2020-08-11 20:55:05 +08:00
curSelectHero = heroData
2020-08-12 20:59:20 +08:00
this.ShowCostInfo()
2020-08-11 20:55:05 +08:00
this.needHero:SetActive(true)
this.replaceHero:SetActive(false)
2020-08-12 14:13:16 +08:00
this.needBg:SetActive(false)
this.replaceBg:SetActive(true)
this.text:SetActive(false)
this.cost:SetActive(true)
2020-08-11 20:55:05 +08:00
this.SetHero(this.needHero,curSelectHero)
--如果已经有了置换Id
if curSelectHero.changeId ~=0 then
2020-08-12 14:13:16 +08:00
2020-08-11 20:55:05 +08:00
this.cancelBtn:SetActive(true)
this.replaceBtn:SetActive(false)
this.saveBtn:SetActive(true)
this.replaceHero:SetActive(true)
2020-08-12 14:13:16 +08:00
this.needBg:SetActive(false)
this.replaceBg:SetActive(false)
this.text:SetActive(false)
this.cost:SetActive(false)
2020-08-13 12:00:18 +08:00
local data = this.RebuildData(curSelectHero.changeId,curSelectHero)
2020-08-11 20:55:05 +08:00
this.SetHero(this.replaceHero,data)
else
2020-08-12 14:13:16 +08:00
2020-08-11 20:55:05 +08:00
this.cancelBtn:SetActive(false)
this.replaceBtn:SetActive(true)
this.saveBtn:SetActive(false)
this.replaceHero:SetActive(false)
2020-08-12 14:13:16 +08:00
this.needBg:SetActive(false)
this.replaceBg:SetActive(true)
this.text:SetActive(false)
this.cost:SetActive(true)
2020-08-11 20:55:05 +08:00
end
end
2020-08-13 16:38:40 +08:00
-- for i = 1, #heroDatas do
-- if heroSelectBtn[i] and heroDatas[i] then
-- heroSelectBtn[i]:SetActive(heroDatas[i].dynamicId == curSelectHero.dynamicId)
-- end
-- end
2020-08-11 20:55:05 +08:00
end)
2020-08-12 14:13:16 +08:00
Util.AddOnceClick(formationMask, function()
local text = ""
for n, w in pairs(FormationManager.formationList) do
for m = 1, #w.teamHeroInfos do
if heroData.dynamicId == w.teamHeroInfos[m].heroId then
local isFormationStr = HeroManager.GetHeroFormationStr2(n)
if isFormationStr ~= "" then
if not text or text == "" then
text = isFormationStr
else
text = text .. ""..isFormationStr
end
end
end
2020-08-12 14:13:16 +08:00
end
end
if text ~= "" then
2021-04-09 12:26:35 +08:00
text = Language[10411]..text..Language[10412]
2020-08-12 14:13:16 +08:00
PopupTipPanel.ShowTip(text)
return
end
if heroData.lockState == 1 then
2021-04-09 12:26:35 +08:00
PopupTipPanel.ShowTip(Language[10419])
2020-08-12 14:13:16 +08:00
return
end
end)
2020-08-11 20:55:05 +08:00
Util.AddLongPressClick(cardBtn, function()
UIManager.OpenPanel(UIName.RoleInfoPopup, heroData)
end, 0.5)
end
--刷新中间按钮和显示
function this.refresh()
-- body
end
--设置两个英雄,左右不确定
function this.SetHero(go,heroData)
local hero = Util.GetGameObject(go, "Hero1")
local herobg=Util.GetGameObject(hero,"Bg1"):GetComponent("Image")
local herolv=Util.GetGameObject(hero,"lv/Text"):GetComponent("Text")
local herofg=Util.GetGameObject(hero,"Bg2"):GetComponent("Image")
local heropro=Util.GetGameObject(hero,"Pro/Image"):GetComponent("Image")
local herostarGrid=Util.GetGameObject(hero,"StarGrid")
local heroname=Util.GetGameObject(hero,"Name/Text"):GetComponent("Text")
local heroyuanImage=Util.GetGameObject(hero,"yuanImage")
local herolive = Util.GetGameObject(hero, "Mask/icon"):GetComponent("RawImage")
local herozs = Util.GetGameObject(hero, "zs")
Util.GetGameObject(hero,"hpProgress").gameObject:SetActive(false)
Util.GetGameObject(hero,"rageProgress").gameObject:SetActive(false)
Util.GetGameObject(hero,"UI_Effect_jinkuang_KaPai").gameObject:SetActive(false)
2023-11-01 15:46:54 +08:00
-- herobg.sprite = this.spLoader:LoadSprite(GetHeroCardStarBg[heroData.star])
2020-08-11 20:55:05 +08:00
local roleConfig = ConfigManager.GetConfigData(ConfigName.RoleConfig, heroData.id)
local scale = roleConfig.play_liveScale
local livePos = Vector3.New(roleConfig.offset[1], roleConfig.offset[2], 0)
if go == this.needHero then
2024-01-13 15:45:40 +08:00
herolive.texture = CardRendererManager.GetSpineTexture(1, heroData.painting, Vector3.one * scale, livePos, true)
2020-08-11 20:55:05 +08:00
else
2024-01-13 15:45:40 +08:00
herolive.texture = CardRendererManager.GetSpineTexture(2, heroData.painting, Vector3.one * scale, livePos, true)
2020-08-11 20:55:05 +08:00
end
herolive.transform.localScale = Vector3.one
herolive.transform.localPosition = Vector3.zero
local zsName = GetHeroCardStarZs[heroData.star]
if zsName == "" then
herozs:SetActive(false)
else
herozs:SetActive(true)
2021-04-21 13:12:04 +08:00
herozs:GetComponent("Image").sprite = this.spLoader:LoadSprite(zsName)
2020-08-11 20:55:05 +08:00
end
2020-08-13 14:43:10 +08:00
heroyuanImage:SetActive(false)
2020-08-11 20:55:05 +08:00
herolv.text=heroData.lv
2021-04-21 13:12:04 +08:00
herofg.sprite = this.spLoader:LoadSprite(GetHeroCardStarFg[heroData.star])
heropro.sprite=this.spLoader:LoadSprite(GetProStrImageByProNum(heroData.property))
2020-08-11 20:55:05 +08:00
SetCardStars(herostarGrid,heroData.star)
if heroData.star > 9 then
Util.GetGameObject(go,"UI_Effect_jinkuang_KaPai").gameObject:SetActive(true)
else
Util.GetGameObject(go,"UI_Effect_jinkuang_KaPai").gameObject:SetActive(false)
end
heroname.text=heroData.name
end
2020-08-05 16:30:02 +08:00
2020-08-11 20:55:05 +08:00
--设置阵营按钮选中
function this.SetBtnSelect(_parObj)
this.selectBtn.transform:SetParent(_parObj.transform)
2023-12-27 19:05:37 +08:00
this.selectBtn.transform:SetAsFirstSibling()
2020-08-11 20:55:05 +08:00
this.selectBtn.transform.localScale = Vector3.one
this.selectBtn.transform.localPosition=Vector3.zero
2020-08-05 16:30:02 +08:00
end
2020-08-12 20:59:20 +08:00
function this.ShowCostInfo()
if replaceItemIdConfig then
2021-04-21 13:12:04 +08:00
this.costImage:GetComponent("Image").sprite = SetIcon(this.spLoader, tonumber(replaceItemIdConfig.Value))
2020-08-12 20:59:20 +08:00
end
2020-08-13 12:00:18 +08:00
2020-08-12 20:59:20 +08:00
if curSelectHero and replaceCostConfig then
local getCostByStar = string.split(replaceCostConfig.Value,"|")
if curSelectHero.star == 4 then
2020-08-13 14:43:10 +08:00
t = tonumber(string.split(getCostByStar[1],"#")[2])
2020-08-12 20:59:20 +08:00
elseif curSelectHero.star == 5 then
2020-08-13 14:43:10 +08:00
t = tonumber(string.split(getCostByStar[2],"#")[2])
end
this.costText.text = t
if t>BagManager.GetTotalItemNum(tonumber(replaceItemIdConfig.Value)) then
this.costText.text = "<color=red>"..t.."</color>"
2020-08-12 20:59:20 +08:00
end
end
end
2020-08-05 16:30:02 +08:00
function this:OnClose()
2020-08-11 20:55:05 +08:00
curSelectHero = {}
curSelectHeroConfig = {}
this.replaceHero:SetActive(false)
this.needHero:SetActive(false)
2020-08-13 17:07:05 +08:00
oldChoose = nil
2020-08-05 16:30:02 +08:00
end
function this:OnDestroy()
2021-04-21 13:12:04 +08:00
this.spLoader:Destroy()
2020-08-13 17:07:05 +08:00
2020-08-05 16:30:02 +08:00
end
2021-04-21 13:12:04 +08:00
return this