diff --git a/Assets/ManagedResources/~Lua/Modules/XiaoYao/XiaoYaoEventPanel.lua b/Assets/ManagedResources/~Lua/Modules/XiaoYao/XiaoYaoEventPanel.lua index 9731f1ccee..c0c5eae7b5 100644 --- a/Assets/ManagedResources/~Lua/Modules/XiaoYao/XiaoYaoEventPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/XiaoYao/XiaoYaoEventPanel.lua @@ -116,11 +116,7 @@ function this:OnShow() end --界面关闭时调用(用于子类重写) -function this:OnClose() - while(this.grid.transform.childCount>0) - do - destroy(this.grid.transform:GetChild(0).gameObject) - end +function this:OnClose() if triggertype>0 then Game.GlobalEvent:DispatchEvent(GameEvent.XiaoYao.PlayEventEffect) end @@ -128,6 +124,10 @@ end --界面销毁时调用(用于子类重写) function this:OnDestroy() + while(this.grid.transform.childCount>0) + do + destroy(this.grid.transform:GetChild(0).gameObject) + end this.spLoader:Destroy() end