四元阵动画播两遍修改

dev_chengFeng
jiaoyangna 2021-07-30 10:00:26 +08:00
parent f5584b0fbe
commit 8c0060a835
2 changed files with 17 additions and 9 deletions

View File

@ -1,4 +1,5 @@
ElementDrawCardPanelNew = {} ElementDrawCardPanelNew = {}
local isPlayAnim = true
function ElementDrawCardPanelNew:New(gameObject) function ElementDrawCardPanelNew:New(gameObject)
local b = {} local b = {}
b.gameObject = gameObject b.gameObject = gameObject
@ -142,6 +143,7 @@ end
function ElementDrawCardPanelNew:OnOpen(_Config,_index, parent) function ElementDrawCardPanelNew:OnOpen(_Config,_index, parent)
self.config = _Config self.config = _Config
self.parent = parent self.parent = parent
isPlayAnim = true
end end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写) --界面打开或者重新打开后,界面刷新时调用(用于子类重写)
@ -157,6 +159,8 @@ function ElementDrawCardPanelNew:OnShow(orginLayer)
Util.SetParticleSortLayer(self.UI_effect_RecruitPanel_particle, self.sortingOrder + 1) Util.SetParticleSortLayer(self.UI_effect_RecruitPanel_particle, self.sortingOrder + 1)
Util.SetParticleSortLayer(self.qianghua, self.sortingOrder + 1) Util.SetParticleSortLayer(self.qianghua, self.sortingOrder + 1)
self.itemPosCom.enabled = false self.itemPosCom.enabled = false
if isPlayAnim then
isPlayAnim = false
local anims = self.gameObject:GetComponentsInChildren(typeof(PlayFlyAnim)) local anims = self.gameObject:GetComponentsInChildren(typeof(PlayFlyAnim))
if anims.Length > 0 then if anims.Length > 0 then
for i = 0, anims.Length - 1 do for i = 0, anims.Length - 1 do
@ -168,6 +172,7 @@ function ElementDrawCardPanelNew:OnShow(orginLayer)
end end
end end
end end
end
-- Timer.New(function() -- Timer.New(function()
-- self.itemPosCom.enabled = true -- self.itemPosCom.enabled = true
-- end,0.5):Start() -- end,0.5):Start()
@ -176,6 +181,7 @@ end
--界面关闭时调用(用于子类重写) --界面关闭时调用(用于子类重写)
function ElementDrawCardPanelNew:OnClose() function ElementDrawCardPanelNew:OnClose()
isPlayAnim = true
self.gameObject:SetActive(false) self.gameObject:SetActive(false)
end end

View File

@ -439,8 +439,10 @@ function this:PageOnChange(isShow)
end end
end end
for k,v in pairs(subViewList) do for k,v in pairs(subViewList) do
if k ~= self.curPage then
v.sub:OnClose() v.sub:OnClose()
end end
end
if subViewList[self.curPage] and subViewList[self.curPage].config and subViewList[self.curPage].sub then if subViewList[self.curPage] and subViewList[self.curPage].config and subViewList[self.curPage].sub then
subViewList[self.curPage].sub:OnShow(orginLayer) subViewList[self.curPage].sub:OnShow(orginLayer)
else else