替换图片

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

@ -58,11 +58,11 @@ function RoleListPanel:InitComponent()
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
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)