From e277760221601cb39a7147627df93623d058fe45 Mon Sep 17 00:00:00 2001 From: gaoxin Date: Wed, 21 Apr 2021 22:45:37 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=86=85=E5=AD=98=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91=E4=BF=AE=E5=A4=8D=E8=B5=84=E6=BA=90=E5=8D=B8=E8=BD=BD?= =?UTF-8?q?=E6=97=B6=E4=BC=9A=E9=94=99=E8=AF=AF=E5=8D=B8=E8=BD=BD=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E7=95=8C=E9=9D=A2=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Common/SpriteLoader.lua | 8 ++-- .../~Lua/Modules/Map/Logic/TileMapView.lua | 2 +- .../~Lua/View/ElementalResonanceView.lua | 45 +++++++++---------- 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Common/SpriteLoader.lua b/Assets/ManagedResources/~Lua/Modules/Common/SpriteLoader.lua index a56099c1bf..7c2800b343 100644 --- a/Assets/ManagedResources/~Lua/Modules/Common/SpriteLoader.lua +++ b/Assets/ManagedResources/~Lua/Modules/Common/SpriteLoader.lua @@ -3,10 +3,10 @@ local SpriteLoader = {} -- 调用此方法创建一个管理器 function SpriteLoader.New() - -- 判断对象池里有没有 - if #SpriteLoaderPool > 0 then - return table.remove(SpriteLoaderPool, 1) - end + -- -- 判断对象池里有没有 + -- if #SpriteLoaderPool > 0 then + -- return table.remove(SpriteLoaderPool, 1) + -- end -- 没有新建 local o = {} o.SpriteList = {} diff --git a/Assets/ManagedResources/~Lua/Modules/Map/Logic/TileMapView.lua b/Assets/ManagedResources/~Lua/Modules/Map/Logic/TileMapView.lua index 57756a61d8..e371ccc5b8 100644 --- a/Assets/ManagedResources/~Lua/Modules/Map/Logic/TileMapView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Map/Logic/TileMapView.lua @@ -144,7 +144,7 @@ function this.SetSpriteBG(sprite) end function this.Exit() - -- this.spLoader:Destroy() + this.spLoader:Destroy() _tileLivePool = nil _tileClearPool = nil ViewCamera = nil diff --git a/Assets/ManagedResources/~Lua/View/ElementalResonanceView.lua b/Assets/ManagedResources/~Lua/View/ElementalResonanceView.lua index 64a2f3853e..1399125fc8 100644 --- a/Assets/ManagedResources/~Lua/View/ElementalResonanceView.lua +++ b/Assets/ManagedResources/~Lua/View/ElementalResonanceView.lua @@ -1,6 +1,5 @@ ----- 元素共鸣 ----- ElementalResonanceView = {} -local this = ElementalResonanceView local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig) local monsterConfig = ConfigManager.GetConfig(ConfigName.MonsterConfig) local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig) @@ -16,56 +15,56 @@ function ElementalResonanceView:New(gameObject) return b end -function this:InitComponent() - this.spLoader = SpriteLoader.New() +function ElementalResonanceView:InitComponent() + self.spLoader = SpriteLoader.New() self.elementalResonanceBtn = Util.GetGameObject(self.gameObject, "elementalResonanceBtn") - this.orginLayer = 0 - this.effect = Util.GetGameObject(self.elementalResonanceBtn, "effect") + self.orginLayer = 0 + self.effect = Util.GetGameObject(self.elementalResonanceBtn, "effect") self.elementalResonanceImage = Util.GetGameObject(self.gameObject, "elementalResonanceBtn/bgImage/Image"):GetComponent("Image") end -function this:BindEvent() +function ElementalResonanceView:BindEvent() -- 功能开启列表 Util.AddClick(self.elementalResonanceBtn, function() - UIManager.OpenPanel(UIName.ElementPopup, self.dataTable,this.thisPanelOrder) + UIManager.OpenPanel(UIName.ElementPopup, self.dataTable,self.thisPanelOrder) end) end -function this:AddListener() +function ElementalResonanceView:AddListener() end -function this:RemoveListener() +function ElementalResonanceView:RemoveListener() end -function this:OnOpen(context) +function ElementalResonanceView:OnOpen(context) if context then - this.SetOrderStatus(context) + self:SetOrderStatus(context) end end -function this:OnClose() +function ElementalResonanceView:OnClose() UIManager.ClosePanel(UIName.ElementPopup) - this.spLoader:Destroy() + self.spLoader:Destroy() end --设定层级 -function this.SetOrderStatus(context) +function ElementalResonanceView:SetOrderStatus(context) if not context then return end local sortingOrder = context.sortOrder + 90 -- Log(""..sortOrder.."") - this.thisPanelOrder = context.sortOrder + self.thisPanelOrder = context.sortOrder --self.transform:GetComponent("Canvas").sortingOrder = sortingOrder - Util.AddParticleSortLayer(this.effect, sortingOrder - this.orginLayer) - this.orginLayer = sortingOrder + Util.AddParticleSortLayer(self.effect, sortingOrder - self.orginLayer) + self.orginLayer = sortingOrder end --得到元素共鸣类型 -- 1.火 2.风 3.水 4.大地 -function this:GetElementalType(curFormation, type) +function ElementalResonanceView:GetElementalType(curFormation, type) elementPropertyList = {} local fireElementNum = 0 local windyElementNum = 0 @@ -150,16 +149,16 @@ function this:GetElementalType(curFormation, type) local isShow = false isShow = indexChoose > 0 if (isShow == false) then - self.elementalResonanceImage.sprite = this.spLoader:LoadSprite("r_zhandou_yuansu_01") + self.elementalResonanceImage.sprite = self.spLoader:LoadSprite("r_zhandou_yuansu_01") else if indexChoose > 0 then - self.elementalResonanceImage.sprite = this.spLoader:LoadSprite(ImageList[indexChoose]) + self.elementalResonanceImage.sprite = self.spLoader:LoadSprite(ImageList[indexChoose]) end end - this.effect:SetActive(isShow) + self.effect:SetActive(isShow) end -function this:SetPosition(type) +function ElementalResonanceView:SetPosition(type) if (type == 1) then -- self.elementalResonanceBtn.transform.localPosition = Vector3.New(455, 783, 0) self.elementalResonanceBtn.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(1, 1) @@ -181,6 +180,6 @@ function this:SetPosition(type) end end -function this:SetElementalPropertyTextColor() +function ElementalResonanceView:SetElementalPropertyTextColor() end return ElementalResonanceView \ No newline at end of file