From 262b07d1afbb6e75fd6587720f02c950ee5026bb Mon Sep 17 00:00:00 2001 From: gaoxin Date: Wed, 28 Apr 2021 05:43:52 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=89=A7=E6=83=85=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=BF=9E=E7=BB=AD=E6=92=AD=E6=94=BE=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E5=89=A7=E6=83=85=E5=AF=BC=E8=87=B4=E9=87=8D=E5=A4=8D=E5=BC=95?= =?UTF-8?q?=E5=AF=BC=E9=A6=96=E5=85=85=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/Guide/GuidePanel.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Guide/GuidePanel.lua b/Assets/ManagedResources/~Lua/Modules/Guide/GuidePanel.lua index 37ad257e40..f96067a1e5 100644 --- a/Assets/ManagedResources/~Lua/Modules/Guide/GuidePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Guide/GuidePanel.lua @@ -483,9 +483,11 @@ function this.ShowStory(nextId,OnFocus) if isShowStory == 1 then LogGreen("this.gameObject:"..this.gameObject.name) this.gameObject:SetActive(false) - Game.GlobalEvent:AddEvent(GameEvent.GuaJi.CloseStoryMapPanel,function() - this.GameSetActive(nextId,OnFocus) - end) + local function onCloseStoryMapPanel() + this.GameSetActive(nextId, OnFocus) + Game.GlobalEvent:RemoveEvent(GameEvent.GuaJi.CloseStoryMapPanel,onCloseStoryMapPanel) + end + Game.GlobalEvent:AddEvent(GameEvent.GuaJi.CloseStoryMapPanel,onCloseStoryMapPanel) PlayerPrefs.SetInt("StoryMapPanel1"..PlayerManager.uid,0) StoryMapManager.InitData(1) else @@ -500,9 +502,8 @@ function this.ShowStory(nextId,OnFocus) end end -function this.GameSetActive(nextId,OnFocus) +function this.GameSetActive(nextId, OnFocus) this.gameObject:SetActive(true) - Game.GlobalEvent:RemoveEvent(GameEvent.GuaJi.CloseStoryMapPanel,this.GameSetActive) this.NextGuide(nextId) Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, OnFocus) Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnFocus, OnFocus)