替换图片

onepiece_demo_arena
xiejun 2024-01-12 18:11:52 +08:00
parent cd957c7e84
commit 56d75b172a
2 changed files with 2848 additions and 151 deletions

View File

@ -8,7 +8,7 @@ local teamHero = {}
local roleDatas={}
this.isFirstOpen=true
local tabs = {}
local tabsImg = {"z_icon_01_zh", "r_hero_huo 1_zh", "r_hero_feng 1_zh", "r_hero_shui 1_zh", "r_hero_dadi 1_zh","z_icon_qingjinbao"}
local tabsImg = {"z_icon_01_zh","r_hero_huo 1_zh", "r_hero_feng 1_zh", "r_hero_shui 1_zh", "r_hero_dadi 1_zh","z_icon_qingjinbao"}
local soulPrintData={}
local orginLayer = 0
local orginLayer2 = 0
@ -57,12 +57,12 @@ function RoleListPanel:InitComponent()
end
this.btnPrant = Util.GetGameObject(self.gameObject, "Tabs")
for i = 0, 6 do
tabs[i] = Util.GetGameObject(self.transform, "Tabs/grid/box/Btn" .. i)
local name=Util.GetGameObject(tabs[i], "Text"):GetComponent("Text")
name.text=PropertyType[i]
-- if tabsImg[i + 1] then
-- Util.GetGameObject(tabs[i], "Image"):GetComponent("Image").sprite = this.spLoader:LoadSprite(tabsImg[i + 1])
-- end
tabs[i] = Util.GetGameObject(self.transform, "Tabs/grid/box/Btn" .. i)
local nameTxt=Util.GetGameObject(self.transform, "Tabs/grid/box/Btn" .. i.."/Text"):GetComponent("Text")
nameTxt.text=PropertyType[i]
if tabsImg[i+1] then
Util.GetGameObject(tabs[i], "Image"):GetComponent("Image").sprite = self.spLoader:LoadSprite(tabsImg[i+1])
end
end
this.ShaiXuanBtn = Util.GetGameObject(self.gameObject, "ShaiXuanBtn")
this.ShaiXuanBtnLv = Util.GetGameObject(self.gameObject, "ShaiXuanBtn/Lv")
@ -342,7 +342,8 @@ end
function this:SetSelectBtn()
this.selectBtn.transform:SetParent(tabs[proId].transform)
this.selectBtn:GetComponent("RectTransform").localPosition = Vector3.zero
Util.GetGameObject( this.selectBtn.transform, "Text"):GetComponent("Text").text=Util.GetGameObject( tabs[proId].transform, "Text"):GetComponent("Text").text
this.selectBtn.transform:SetAsFirstSibling()
-- Util.GetGameObject( this.selectBtn.transform, "Text"):GetComponent("Text").text=Util.GetGameObject( t abs[proId].transform, "Text"):GetComponent("Text").text
end
function this:SortHeroDatas(_heroDatas)