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)