From 8c0060a83588950979689e390938b0031efa6483 Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Fri, 30 Jul 2021 10:00:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9B=E5=85=83=E9=98=B5=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=E6=92=AD=E4=B8=A4=E9=81=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Recruit/ElementDrawCardPanelNew.lua | 22 ++++++++++++------- .../~Lua/Modules/Recruit/RecruitMainPanel.lua | 4 +++- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Recruit/ElementDrawCardPanelNew.lua b/Assets/ManagedResources/~Lua/Modules/Recruit/ElementDrawCardPanelNew.lua index 32d4cfd785..286fa196a6 100644 --- a/Assets/ManagedResources/~Lua/Modules/Recruit/ElementDrawCardPanelNew.lua +++ b/Assets/ManagedResources/~Lua/Modules/Recruit/ElementDrawCardPanelNew.lua @@ -1,4 +1,5 @@ ElementDrawCardPanelNew = {} +local isPlayAnim = true function ElementDrawCardPanelNew:New(gameObject) local b = {} b.gameObject = gameObject @@ -142,6 +143,7 @@ end function ElementDrawCardPanelNew:OnOpen(_Config,_index, parent) self.config = _Config self.parent = parent + isPlayAnim = true end --界面打开或者重新打开后,界面刷新时调用(用于子类重写) @@ -157,14 +159,17 @@ function ElementDrawCardPanelNew:OnShow(orginLayer) Util.SetParticleSortLayer(self.UI_effect_RecruitPanel_particle, self.sortingOrder + 1) Util.SetParticleSortLayer(self.qianghua, self.sortingOrder + 1) self.itemPosCom.enabled = false - local anims = self.gameObject:GetComponentsInChildren(typeof(PlayFlyAnim)) - if anims.Length > 0 then - for i = 0, anims.Length - 1 do - local anim = anims[i] - if anim.isPlayOnOpen then - anim:PlayAnim(false,function() - self.itemPosCom.enabled = true - end) + if isPlayAnim then + isPlayAnim = false + local anims = self.gameObject:GetComponentsInChildren(typeof(PlayFlyAnim)) + if anims.Length > 0 then + for i = 0, anims.Length - 1 do + local anim = anims[i] + if anim.isPlayOnOpen then + anim:PlayAnim(false,function() + self.itemPosCom.enabled = true + end) + end end end end @@ -176,6 +181,7 @@ end --界面关闭时调用(用于子类重写) function ElementDrawCardPanelNew:OnClose() + isPlayAnim = true self.gameObject:SetActive(false) end diff --git a/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitMainPanel.lua b/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitMainPanel.lua index e9d235b14d..ac51007de5 100644 --- a/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitMainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitMainPanel.lua @@ -439,7 +439,9 @@ function this:PageOnChange(isShow) end end for k,v in pairs(subViewList) do - v.sub:OnClose() + if k ~= self.curPage then + v.sub:OnClose() + end end if subViewList[self.curPage] and subViewList[self.curPage].config and subViewList[self.curPage].sub then subViewList[self.curPage].sub:OnShow(orginLayer)