From 868643f87cbcd7426c38fc02c7358515cedc1960 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Thu, 22 Apr 2021 18:26:48 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90spLoader=E3=80=91=E5=A4=84=E7=90=86?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E7=99=BD=E7=89=87=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/ManagedResources/~Lua/Modules/Bag/BagPanel.lua | 6 ++++-- .../~Lua/Modules/Battle/View/BattleView.lua | 1 + .../~Lua/Modules/Formation/FormationPanel.lua | 1 + .../~Lua/Modules/Formation/FormationPanelV2.lua | 5 +++++ .../~Lua/Modules/RoleInfo/RoleListPanel.lua | 6 ++++++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Bag/BagPanel.lua b/Assets/ManagedResources/~Lua/Modules/Bag/BagPanel.lua index 655224aa90..a24dd9bd41 100644 --- a/Assets/ManagedResources/~Lua/Modules/Bag/BagPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Bag/BagPanel.lua @@ -17,14 +17,16 @@ function BagPanel:InitComponent() this.spLoader = SpriteLoader.New() this.BtnBack = Util.GetGameObject(self.transform, "rightUp/btnBack") - for i = 0, 7 do + for i = 1, 7 do tabs1[i] = Util.GetGameObject(self.transform, "box/Btn" .. i) tabs1RedPoint[i] = Util.GetGameObject(self.transform, "box/Btn" .. i .. "/redPoint") + tabs1[i]:GetComponent("Image").sprite = this.spLoader:LoadSprite("r_hero_xuanze_002") end if not this.playerInfoView then this.playerInfoView = SubUIManager.Open(SubUIConfig.PlayerInfoView, this.transform) end this.selectBtn1 = Util.GetGameObject(self.gameObject, "selectBtn") + this.selectBtn1:GetComponent("Image").sprite = this.spLoader:LoadSprite("r_hero_xuanze_001") this.BtView = SubUIManager.Open(SubUIConfig.BtView, self.gameObject.transform) this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform) this.fenJieBtn = Util.GetGameObject(self.gameObject, "fenJieBtn") @@ -50,7 +52,7 @@ function BagPanel:BindEvent() PlaySoundWithoutClick(SoundConfig.Sound_UICancel) self:ClosePanel() end) - for i = 0, 7 do + for i = 1, 7 do Util.AddClick(tabs1[i], function() if this.isFristOpen == false then if i == sortIndex then diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua index 2be501b6bc..f69f570ce6 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattleView.lua @@ -594,6 +594,7 @@ function this.BattleOrderChange(order) enemyLivePos.localScale = Vector3.zero local myPos = Util.GetTransform(this.PlayerPanel, "View/"..i.."/root") + myPos:GetComponent("Image").sprite = this.spLoader:LoadSprite("bd_xinkapaifan") myPos.localScale = Vector3.one end diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanel.lua b/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanel.lua index d856659e20..edecc66108 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanel.lua @@ -70,6 +70,7 @@ local orginLayer local orginLayer1 local orginLayer2 local list = {} +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"} --初始化组件(用于子类重写) function this:InitComponent() this.spLoader = SpriteLoader.New() diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua b/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua index 0406575f06..5a64dbf9ec 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua @@ -36,6 +36,7 @@ local tempPowerNum=0 --临时战力 local panelType +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"} -- 各个类型编队系统逻辑列表 this.PanelOptionView = { [FORMATION_TYPE.CARBON] = "Modules/Formation/View/CarbonFormation", @@ -70,6 +71,7 @@ function this:InitComponent() this.effect = Util.GetGameObject(this.gameObject, "effect") this.power = Util.GetGameObject(this.gameObject, "Power/Value"):GetComponent("Text") this.root=Util.GetGameObject(this.gameObject,"Root") + Util.GetGameObject(this.gameObject, "Power"):GetComponent("Image").sprite = this.spLoader:LoadSprite("t_tongyong-zhanli_zh") this.roleGrid=Util.GetGameObject(this.gameObject,"RoleGrid") this.line=Util.GetGameObject(this.gameObject,"RoleGrid/Line") @@ -108,6 +110,9 @@ function this:InitComponent() --筛选按钮 for i = 0, 4 do tabs[i] = Util.GetGameObject(this.gameObject, "Tabs/Grid/Btn" .. i) + if tabsImg[i + 1] then + Util.GetGameObject(tabs[i], "Image"):GetComponent("Image").sprite = this.spLoader:LoadSprite(tabsImg[i + 1]) + end end this.selectBtn = Util.GetGameObject(this.gameObject, "Tabs/SelectBtn") diff --git a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleListPanel.lua b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleListPanel.lua index d0128de7e2..f9975c643f 100644 --- a/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleListPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/RoleInfo/RoleListPanel.lua @@ -8,6 +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"} local soulPrintData={} local orginLayer = 0 local orginLayer2 = 0 @@ -23,10 +24,15 @@ function RoleListPanel:InitComponent() this.btnPrant = Util.GetGameObject(self.gameObject, "Tabs") for i = 0, 6 do tabs[i] = Util.GetGameObject(self.transform, "Tabs/grid/Btn" .. i) + if tabsImg[i + 1] then + Util.GetGameObject(tabs[i], "Image"):GetComponent("Image").sprite = this.spLoader:LoadSprite(tabsImg[i + 1]) + end end this.ShaiXuanBtn = Util.GetGameObject(self.gameObject, "ShaiXuanBtn") this.ShaiXuanBtnLv = Util.GetGameObject(self.gameObject, "ShaiXuanBtn/Lv") + this.ShaiXuanBtnLv:GetComponent("Image").sprite = this.spLoader:LoadSprite("r_tongyong_dengjiqiehuan_zh") this.ShaiXuanBtnQu = Util.GetGameObject(self.gameObject, "ShaiXuanBtn/Qu") + this.ShaiXuanBtnQu:GetComponent("Image").sprite = this.spLoader:LoadSprite("r_tongyong_pingjieqiehuan_zh") this.selectBtn = Util.GetGameObject(self.gameObject, "Tabs/selectBtn") this.heroNumText = Util.GetGameObject(self.gameObject, "heroNum") this.ScrollBar = Util.GetGameObject(self.gameObject, "Scrollbar"):GetComponent("Scrollbar")