图鉴优化
parent
9a53f20f60
commit
e9438df1b7
File diff suppressed because it is too large
Load Diff
|
@ -3,14 +3,15 @@ HandBookHeroAndEquipListPanel = Inherit(BasePanel)
|
|||
|
||||
local OpenType = 0 --1 英雄 2装备 3 法宝
|
||||
|
||||
--英雄列表
|
||||
local tenGridList = {}
|
||||
local sexGridList = {}
|
||||
local fiveGridList = {}
|
||||
local fourGridList = {}
|
||||
local threeGridList = {}
|
||||
local twoGridList = {}
|
||||
local oneGridList = {}
|
||||
-- --英雄列表
|
||||
-- local tenGridList = {}
|
||||
-- local sexGridList = {}
|
||||
-- local fiveGridList = {}
|
||||
-- local fourGridList = {}
|
||||
-- local threeGridList = {}
|
||||
-- local twoGridList = {}
|
||||
-- local oneGridList = {}
|
||||
|
||||
--装备列表
|
||||
local chuanShuoGridList = {}
|
||||
local shiShiGridList = {}
|
||||
|
@ -25,6 +26,9 @@ local proId=0--0 全部 1 火 2风 3 水 4 地 5 光 6 暗
|
|||
local tabs = {}
|
||||
local orginLayer = 0
|
||||
local orginLayer2 = 0
|
||||
|
||||
local gridListData = {}
|
||||
local heroNumList = {}
|
||||
--初始化组件(用于子类重写)
|
||||
function HandBookHeroAndEquipListPanel:InitComponent()
|
||||
|
||||
|
@ -38,29 +42,16 @@ function HandBookHeroAndEquipListPanel:InitComponent()
|
|||
self.card:GetComponent("RectTransform").localScale = Vector3.New(1,1,1)
|
||||
Util.GetGameObject(self.card, "choosed").gameObject:SetActive(false)
|
||||
Util.GetGameObject(self.card, "redAndLock").gameObject:SetActive(false)
|
||||
self.tenGrid = Util.GetGameObject(self.heroScroll.transform, "grid/tenGrid")
|
||||
self.sexGrid = Util.GetGameObject(self.heroScroll.transform, "grid/sexGrid")
|
||||
self.fiveGrid = Util.GetGameObject(self.heroScroll.transform, "grid/fiveGrid")
|
||||
self.fourGrid = Util.GetGameObject(self.heroScroll.transform, "grid/fourGrid")
|
||||
self.threeGrid = Util.GetGameObject(self.heroScroll.transform, "grid/threeGrid")
|
||||
self.twoGrid = Util.GetGameObject(self.heroScroll.transform, "grid/twoGrid")
|
||||
self.oneGrid = Util.GetGameObject(self.heroScroll.transform, "grid/oneGrid")
|
||||
|
||||
self.tenStar = Util.GetGameObject(self.heroScroll.transform, "grid/tenStarNum")
|
||||
self.sexStar = Util.GetGameObject(self.heroScroll.transform, "grid/sexStarNum")
|
||||
self.fiveStar = Util.GetGameObject(self.heroScroll.transform, "grid/fiveStarNum")
|
||||
self.fourStar = Util.GetGameObject(self.heroScroll.transform, "grid/fourStarNum")
|
||||
self.threeStar = Util.GetGameObject(self.heroScroll.transform, "grid/threeStarNum")
|
||||
self.twoStar = Util.GetGameObject(self.heroScroll.transform, "grid/twoStarNum")
|
||||
self.oneStar = Util.GetGameObject(self.heroScroll.transform, "grid/oneStarNum")
|
||||
|
||||
self.tenStarNum = Util.GetGameObject(self.heroScroll.transform, "grid/tenStarNum/star/Text/Text (1)"):GetComponent("Text")
|
||||
self.sexStarNum = Util.GetGameObject(self.heroScroll.transform, "grid/sexStarNum/star/Text/Text (1)"):GetComponent("Text")
|
||||
self.fiveStarNum = Util.GetGameObject(self.heroScroll.transform, "grid/fiveStarNum/star/Text/Text (1)"):GetComponent("Text")
|
||||
self.fourStarNum = Util.GetGameObject(self.heroScroll.transform, "grid/fourStarNum/star/Text/Text (1)"):GetComponent("Text")
|
||||
self.threeStarNum = Util.GetGameObject(self.heroScroll.transform, "grid/threeStarNum/star/Text/Text (1)"):GetComponent("Text")
|
||||
self.twoStarNum = Util.GetGameObject(self.heroScroll.transform, "grid/twoStarNum/star/Text/Text (1)"):GetComponent("Text")
|
||||
self.oneStarNum = Util.GetGameObject(self.heroScroll.transform, "grid/oneStarNum/star/Text/Text (1)"):GetComponent("Text")
|
||||
self.starNum = Util.GetGameObject(self.transform, "starNum")
|
||||
self.heroprefab = Util.GetGameObject(self.transform, "heroprefab")
|
||||
self.scrollRoot = Util.GetGameObject(self.transform, "heroScroll")
|
||||
local rootHight = self.scrollRoot.transform.rect.height
|
||||
local sv = SubUIManager.Open(SubUIConfig.ScrollFitterView, self.scrollRoot.transform,
|
||||
self.heroprefab, Vector2.New(1080, rootHight - 10), 1, 17)
|
||||
sv.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(0, -5)
|
||||
-- 保存
|
||||
self.SystemScrollView = sv
|
||||
|
||||
--装备
|
||||
self.equipScroll = Util.GetGameObject(self.transform, "equipScroll")
|
||||
|
@ -85,14 +76,6 @@ function HandBookHeroAndEquipListPanel:InitComponent()
|
|||
self.violetNum=Util.GetGameObject(self.talismanScroll.transform,"Grid/VioletNum/NumInfo/NumText/Text"):GetComponent("Text")
|
||||
self.blueNum=Util.GetGameObject(self.talismanScroll.transform,"Grid/BlueNum/NumInfo/NumText/Text"):GetComponent("Text")
|
||||
|
||||
tenGridList = {}
|
||||
sexGridList = {}
|
||||
fiveGridList = {}
|
||||
fourGridList = {}
|
||||
threeGridList = {}
|
||||
twoGridList = {}
|
||||
oneGridList = {}
|
||||
|
||||
chuanShuoGridList = {}
|
||||
shiShiGridList = {}
|
||||
youXiuGridList = {}
|
||||
|
@ -103,14 +86,6 @@ function HandBookHeroAndEquipListPanel:InitComponent()
|
|||
blueGridList={}
|
||||
|
||||
for i = 1, 1 do
|
||||
tenGridList[i] = Util.GetGameObject(self.heroScroll.transform, "grid/tenGrid/card ("..i..")")
|
||||
sexGridList[i] = Util.GetGameObject(self.heroScroll.transform, "grid/sexGrid/card ("..i..")")
|
||||
fiveGridList[i] = Util.GetGameObject(self.heroScroll.transform, "grid/fiveGrid/card ("..i..")")
|
||||
fourGridList[i] = Util.GetGameObject(self.heroScroll.transform, "grid/fourGrid/card ("..i..")")
|
||||
threeGridList[i] = Util.GetGameObject(self.heroScroll.transform, "grid/threeGrid/card ("..i..")")
|
||||
twoGridList[i] = Util.GetGameObject(self.heroScroll.transform, "grid/twoGrid/card ("..i..")")
|
||||
oneGridList[i] = Util.GetGameObject(self.heroScroll.transform, "grid/oneGrid/card ("..i..")")
|
||||
|
||||
chuanShuoGridList[i] = Util.GetGameObject(self.equipScroll.transform, "grid/chuanShuoGrid/equip ("..i..")")
|
||||
shiShiGridList[i] = Util.GetGameObject(self.equipScroll.transform, "grid/shiShiGrid/equip ("..i..")")
|
||||
youXiuGridList[i] = Util.GetGameObject(self.equipScroll.transform, "grid/youXiuGrid/equip ("..i..")")
|
||||
|
@ -167,7 +142,6 @@ function HandBookHeroAndEquipListPanel:OnOpen(_type)
|
|||
end
|
||||
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
||||
function HandBookHeroAndEquipListPanel:OnShow()
|
||||
|
||||
proId = 0
|
||||
if OpenType == 1 then
|
||||
self.heroScroll:SetActive(true)
|
||||
|
@ -211,33 +185,11 @@ function HandBookHeroAndEquipListPanel:OnDestroy()
|
|||
--SubUIManager.Close(self.BtView2)
|
||||
end
|
||||
function HandBookHeroAndEquipListPanel:OnSortingOrderChange()
|
||||
for _,go in pairs(tenGridList) do
|
||||
Util.AddParticleSortLayer(go, self.sortingOrder - orginLayer)
|
||||
end
|
||||
for _,go in pairs(sexGridList) do
|
||||
Util.AddParticleSortLayer(go, self.sortingOrder - orginLayer)
|
||||
end
|
||||
for _,go in pairs(fiveGridList) do
|
||||
Util.AddParticleSortLayer(go, self.sortingOrder - orginLayer)
|
||||
end
|
||||
for _,go in pairs(fourGridList) do
|
||||
Util.AddParticleSortLayer(go, self.sortingOrder - orginLayer)
|
||||
end
|
||||
for _,go in pairs(threeGridList) do
|
||||
Util.AddParticleSortLayer(go, self.sortingOrder - orginLayer)
|
||||
end
|
||||
for _,go in pairs(twoGridList) do
|
||||
Util.AddParticleSortLayer(go, self.sortingOrder - orginLayer)
|
||||
end
|
||||
for _,go in pairs(oneGridList) do
|
||||
Util.AddParticleSortLayer(go, self.sortingOrder - orginLayer)
|
||||
end
|
||||
|
||||
orginLayer = self.sortingOrder
|
||||
end
|
||||
|
||||
--英雄展示
|
||||
function HandBookHeroAndEquipListPanel:OnShowHeroFun()
|
||||
self:SetSelectBtn()
|
||||
function HandBookHeroAndEquipListPanel:GetHeroData()
|
||||
--得到所有的对应星级的英雄
|
||||
local tenHeroList = {}
|
||||
local sexHeroList = {}
|
||||
|
@ -272,7 +224,7 @@ function HandBookHeroAndEquipListPanel:OnShowHeroFun()
|
|||
self:SortHeroNatural(threeHeroList)
|
||||
self:SortHeroNatural(twoHeroList)
|
||||
self:SortHeroNatural(oneHeroList)
|
||||
|
||||
--设置图鉴的循环列表
|
||||
local herodatas={}
|
||||
herodatas[10]=tenHeroList
|
||||
herodatas[6]=sexHeroList
|
||||
|
@ -281,9 +233,56 @@ function HandBookHeroAndEquipListPanel:OnShowHeroFun()
|
|||
herodatas[3]=threeHeroList
|
||||
herodatas[2]=twoHeroList
|
||||
herodatas[1]=oneHeroList
|
||||
PlayerManager.heroHandBookListData=herodatas
|
||||
PlayerManager.heroHandBookListData = herodatas
|
||||
|
||||
--计算玩家拥有的英雄中对应星级的英雄的数量
|
||||
local heroScrolldatas = {}
|
||||
self:HeroHaveNum()
|
||||
local temp = 0
|
||||
for k,v in pairs(herodatas) do
|
||||
temp = 0
|
||||
if v and #v > 0 then
|
||||
LogGreen("star:"..k.." heroCount:"..#v.." HeroHaveNum:"..heroNumList[k])
|
||||
local str = Language[11096]..heroNumList[k].."/"..#v
|
||||
table.insert(heroScrolldatas,{type = 2,star = k,index = 0,content = str })
|
||||
for i = 1,#v do
|
||||
if i%5 == 0 or i == #v then
|
||||
local tempData = {}
|
||||
for n = 1, i - temp do
|
||||
table.insert(tempData,v[n])
|
||||
end
|
||||
if i%5 ==0 then
|
||||
table.insert(heroScrolldatas,{type = 1,star = k,index = math.floor(i/5), content = tempData })
|
||||
else
|
||||
table.insert(heroScrolldatas,{type = 1,star = k,index = math.floor(i/5) + 1, content = tempData })
|
||||
end
|
||||
temp = i
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
table.sort(heroScrolldatas,function(a,b)
|
||||
if a.star == b.star then
|
||||
if a.type == b.type then
|
||||
return a.index < b.index
|
||||
else
|
||||
return a.type > b.type
|
||||
end
|
||||
else
|
||||
return a.star > b.star
|
||||
end
|
||||
end)
|
||||
for k,v in ipairs(heroScrolldatas) do
|
||||
if v.content and v.type ==1 then
|
||||
LogPink("star:"..v.star.." heroCount:"..#v.content.." index:"..v.index)
|
||||
for n,m in ipairs(v.content) do
|
||||
LogYellow("m.Id:"..m.Id.."m.Star:"..m.Star)
|
||||
end
|
||||
end
|
||||
end
|
||||
return heroScrolldatas
|
||||
end
|
||||
|
||||
function HandBookHeroAndEquipListPanel:HeroHaveNum()
|
||||
local curtenStarActiveNum = 0
|
||||
local cursexStarActiveNum = 0
|
||||
local curfiveStarActiveNum = 0
|
||||
|
@ -291,6 +290,7 @@ function HandBookHeroAndEquipListPanel:OnShowHeroFun()
|
|||
local curthreeStarActiveNum = 0
|
||||
local curtwoStarActiveNum = 0
|
||||
local curoneStarActiveNum = 0
|
||||
--计算玩家拥有的英雄中对应星级的英雄的数量
|
||||
for i, v in pairs(PlayerManager.heroHandBook) do
|
||||
local conFig = ConfigManager.GetConfigData(ConfigName.HeroConfig,i)
|
||||
if conFig then
|
||||
|
@ -312,155 +312,30 @@ function HandBookHeroAndEquipListPanel:OnShowHeroFun()
|
|||
curoneStarActiveNum = curoneStarActiveNum + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
heroNumList[1] = curoneStarActiveNum
|
||||
heroNumList[2] = curtwoStarActiveNum
|
||||
heroNumList[3] = curthreeStarActiveNum
|
||||
heroNumList[4] = curfourStarActiveNum
|
||||
heroNumList[5] = curfiveStarActiveNum
|
||||
heroNumList[6] = cursexStarActiveNum
|
||||
heroNumList[10] = curtenStarActiveNum
|
||||
end
|
||||
|
||||
self.tenStarNum.text = Language[11096]..curtenStarActiveNum.."/"..#tenHeroList
|
||||
self.tenStar.gameObject:SetActive(#tenHeroList>0)
|
||||
self.tenGrid.gameObject:SetActive(#tenHeroList>0)
|
||||
self.sexStarNum.text = Language[11096]..cursexStarActiveNum.."/"..#sexHeroList
|
||||
self.sexStar.gameObject:SetActive(#sexHeroList>0)
|
||||
self.sexGrid.gameObject:SetActive(#tenHeroList>0)
|
||||
self.fiveStarNum.text = Language[11096]..curfiveStarActiveNum.."/"..#fiveHeroList
|
||||
self.fiveStar.gameObject:SetActive(#fiveHeroList>0)
|
||||
self.fiveGrid.gameObject:SetActive(#fiveHeroList>0)
|
||||
self.fourStarNum.text = Language[11096]..curfourStarActiveNum.."/"..#fourHeroList
|
||||
self.fourStar.gameObject:SetActive(#fourHeroList>0)
|
||||
self.fourGrid.gameObject:SetActive(#fourHeroList>0)
|
||||
self.threeStarNum.text = Language[11096]..curthreeStarActiveNum.."/"..#threeHeroList
|
||||
self.threeStar.gameObject:SetActive(#threeHeroList>0)
|
||||
self.threeGrid.gameObject:SetActive(#threeHeroList>0)
|
||||
self.twoStarNum.text = Language[11096]..curtwoStarActiveNum.."/"..#twoHeroList
|
||||
self.twoStar.gameObject:SetActive(#twoHeroList>0)
|
||||
self.twoGrid.gameObject:SetActive(#twoHeroList>0)
|
||||
self.oneStarNum.text = Language[11096]..curoneStarActiveNum.."/"..#oneHeroList
|
||||
self.oneStar.gameObject:SetActive(#oneHeroList>0)
|
||||
self.oneGrid.gameObject:SetActive(#oneHeroList>0)
|
||||
--英雄展示
|
||||
function HandBookHeroAndEquipListPanel:OnShowHeroFun()
|
||||
self:SetSelectBtn()
|
||||
local data = self:GetHeroData()
|
||||
self.SystemScrollView:SetData(data, function(dataIndex, go)
|
||||
LogYellow("dataIndex:"..dataIndex)
|
||||
self:showData(go,data[dataIndex])
|
||||
end,1)
|
||||
|
||||
--十星的
|
||||
for i = 1, math.max(#tenHeroList, #tenGridList) do
|
||||
local go = tenGridList[i]
|
||||
if not go or (go and not go.gameObject) then
|
||||
go = self:GeneralNewGoPre(1,i,self.tenGrid)
|
||||
tenGridList[i] = go
|
||||
end
|
||||
go.gameObject:SetActive(false)
|
||||
end
|
||||
for i = 1, #tenHeroList do
|
||||
tenGridList[i]:SetActive(true)
|
||||
self:OnShowSingleHeroData(tenGridList[i],tenHeroList[i],10,255)
|
||||
end
|
||||
self.tenGrid.gameObject:SetActive(#tenHeroList>0)
|
||||
--六星的
|
||||
for i = 1, math.max(#sexHeroList, #sexGridList) do
|
||||
local go = sexGridList[i]
|
||||
if not go or (go and not go.gameObject) then
|
||||
go = self:GeneralNewGoPre(1,i,self.sexGrid)
|
||||
sexGridList[i] = go
|
||||
end
|
||||
go.gameObject:SetActive(false)
|
||||
end
|
||||
for i = 1, #sexHeroList do
|
||||
sexGridList[i]:SetActive(true)
|
||||
self:OnShowSingleHeroData(sexGridList[i],sexHeroList[i],6,145)
|
||||
end
|
||||
self.sexGrid.gameObject:SetActive(#sexGridList>0)
|
||||
--五星的
|
||||
for i = 1, math.max(#fiveHeroList, #fiveGridList) do
|
||||
local go = fiveGridList[i]
|
||||
if not go or (go and not go.gameObject) then
|
||||
go = self:GeneralNewGoPre(1,i,self.fiveGrid)
|
||||
fiveGridList[i] = go
|
||||
end
|
||||
go.gameObject:SetActive(false)
|
||||
end
|
||||
for i = 1, #fiveHeroList do
|
||||
fiveGridList[i]:SetActive(true)
|
||||
self:OnShowSingleHeroData(fiveGridList[i],fiveHeroList[i])
|
||||
end
|
||||
self.fiveGrid.gameObject:SetActive(#fiveGridList>0)
|
||||
--四星的
|
||||
for i = 1, math.max(#fourHeroList, #fourGridList) do
|
||||
local go = fourGridList[i]
|
||||
if not go or (go and not go.gameObject) then
|
||||
go = self:GeneralNewGoPre(1,i,self.fourGrid)
|
||||
fourGridList[i] = go
|
||||
end
|
||||
go.gameObject:SetActive(false)
|
||||
end
|
||||
for i = 1, #fourHeroList do
|
||||
fourGridList[i]:SetActive(true)
|
||||
self:OnShowSingleHeroData(fourGridList[i],fourHeroList[i])
|
||||
end
|
||||
self.fourGrid.gameObject:SetActive(#fourGridList>0)
|
||||
--三星的
|
||||
for i = 1, math.max(#threeHeroList, #threeGridList) do
|
||||
local go = threeGridList[i]
|
||||
if not go or (go and not go.gameObject) then
|
||||
go = self:GeneralNewGoPre(1,i,self.threeGrid)
|
||||
threeGridList[i] = go
|
||||
end
|
||||
go.gameObject:SetActive(false)
|
||||
end
|
||||
for i = 1, #threeHeroList do
|
||||
threeGridList[i]:SetActive(true)
|
||||
self:OnShowSingleHeroData(threeGridList[i],threeHeroList[i])
|
||||
end
|
||||
self.threeGrid.gameObject:SetActive(#threeGridList>0)
|
||||
--二星的
|
||||
for i = 1, math.max(#twoHeroList, #twoGridList) do
|
||||
local go = twoGridList[i]
|
||||
if not go or (go and not go.gameObject) then
|
||||
go = self:GeneralNewGoPre(1,i,self.twoGrid)
|
||||
twoGridList[i] = go
|
||||
end
|
||||
go.gameObject:SetActive(false)
|
||||
end
|
||||
for i = 1, #twoHeroList do
|
||||
twoGridList[i]:SetActive(true)
|
||||
self:OnShowSingleHeroData(twoGridList[i],twoHeroList[i])
|
||||
end
|
||||
self.twoGrid.gameObject:SetActive(#oneHeroList>0)
|
||||
--一星的
|
||||
for i = 1, math.max(#oneHeroList, #twoGridList) do
|
||||
local go = oneGridList[i]
|
||||
if not go or (go and not go.gameObject) then
|
||||
go = self:GeneralNewGoPre(1,i,self.oneGrid)
|
||||
oneGridList[i] = go
|
||||
end
|
||||
go.gameObject:SetActive(false)
|
||||
end
|
||||
for i = 1, #oneHeroList do
|
||||
oneGridList[i]:SetActive(true)
|
||||
self:OnShowSingleHeroData(oneGridList[i],oneHeroList[i])
|
||||
end
|
||||
self.oneGrid.gameObject:SetActive(#oneHeroList>0)
|
||||
|
||||
for _,go in pairs(tenGridList) do
|
||||
Util.AddParticleSortLayer(go, self.sortingOrder - orginLayer2)
|
||||
end
|
||||
for _,go in pairs(sexGridList) do
|
||||
Util.AddParticleSortLayer(go, self.sortingOrder - orginLayer2)
|
||||
end
|
||||
for _,go in pairs(fiveGridList) do
|
||||
Util.AddParticleSortLayer(go, self.sortingOrder - orginLayer2)
|
||||
end
|
||||
for _,go in pairs(fourGridList) do
|
||||
Util.AddParticleSortLayer(go, self.sortingOrder - orginLayer2)
|
||||
end
|
||||
for _,go in pairs(threeGridList) do
|
||||
Util.AddParticleSortLayer(go, self.sortingOrder - orginLayer2)
|
||||
end
|
||||
for _,go in pairs(twoGridList) do
|
||||
Util.AddParticleSortLayer(go, self.sortingOrder - orginLayer2)
|
||||
end
|
||||
for _,go in pairs(oneGridList) do
|
||||
Util.AddParticleSortLayer(go, self.sortingOrder - orginLayer2)
|
||||
end
|
||||
orginLayer2 =self.sortingOrder
|
||||
orginLayer = self.sortingOrder
|
||||
end
|
||||
|
||||
|
||||
--装备展示
|
||||
function HandBookHeroAndEquipListPanel:OnShowEquipFun()
|
||||
local chuanShuoEquipList = {}
|
||||
|
@ -708,26 +583,50 @@ function HandBookHeroAndEquipListPanel:GeneralNewGoPre(_type,_index,_grid)
|
|||
end
|
||||
return go
|
||||
end
|
||||
|
||||
function HandBookHeroAndEquipListPanel:showData(go,data)
|
||||
local star = Util.GetGameObject(go.transform, "star")
|
||||
star.gameObject:SetActive(false)
|
||||
local item = Util.GetGameObject(go.transform, "singleItem")
|
||||
item.gameObject:SetActive(false)
|
||||
if data.type == 2 then
|
||||
star.gameObject:SetActive(true)
|
||||
SetHeroStars(star,data.star,1,Vector2.New(71,71),-14,Vector2(0.5,0.5))
|
||||
Util.GetGameObject(go.transform, "star/Text"):GetComponent("Text").text = data.content
|
||||
else
|
||||
item.gameObject:SetActive(true)
|
||||
for i = 1,5 do
|
||||
local _go = Util.GetGameObject(item, "card"..i)
|
||||
if i <= #data.content then
|
||||
self:OnShowSingleHeroData(_go,data.content[i],data.star)
|
||||
_go.gameObject:SetActive(true)
|
||||
else
|
||||
_go.gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--设置猎妖师数据
|
||||
function HandBookHeroAndEquipListPanel:OnShowSingleHeroData(...)
|
||||
local param={...}
|
||||
local param = {...}
|
||||
local heroData = param[2]
|
||||
local _go=param[1]
|
||||
local star=heroData.Star
|
||||
local lv = 1
|
||||
if(param[3]) then
|
||||
star=param[3]
|
||||
end
|
||||
local lv=1
|
||||
if param[4] and param[4] > 0 then
|
||||
lv=param[4]
|
||||
if star == 6 then
|
||||
lv = 145
|
||||
elseif star == 10 then
|
||||
lv = 155
|
||||
else
|
||||
lv = 1
|
||||
end
|
||||
SetHeroBg(Util.GetGameObject(_go.transform, "card"), Util.GetGameObject(_go.transform, "card/bg"),star,heroData.Quality)
|
||||
|
||||
if lv and lv > 0 then
|
||||
Util.GetGameObject(_go.transform, "card/lv/Text"):GetComponent("Text").text = lv
|
||||
else
|
||||
Util.GetGameObject(_go.transform, "card/lv/Text"):GetComponent("Text").text = 1
|
||||
end
|
||||
Util.GetGameObject(_go.transform, "card/lv/Text"):GetComponent("Text").text = lv
|
||||
|
||||
Util.GetGameObject(_go.transform, "card/name"):GetComponent("Text").text = heroData.ReadingName
|
||||
Util.GetGameObject(_go.transform, "card/icon"):GetComponent("Image").sprite = Util.LoadSprite(GetResourcePath(heroData.Painting))
|
||||
|
|
Loading…
Reference in New Issue