From b55c8539aa10c39492f983014a3d9a4cf301874a Mon Sep 17 00:00:00 2001 From: Abdullah Aldandarawy Date: Fri, 7 Feb 2020 19:36:53 +0800 Subject: [PATCH] fix #4 --- Window/WindowUILayer.cs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Window/WindowUILayer.cs b/Window/WindowUILayer.cs index 5e6192b..717f65a 100644 --- a/Window/WindowUILayer.cs +++ b/Window/WindowUILayer.cs @@ -70,14 +70,20 @@ public override void HideScreen(IWindowController screen) { AddTransition(screen); screen.Hide(); - CurrentWindow = null; - - if (windowQueue.Count > 0) { - ShowNextInQueue(); - } - else if (windowHistory.Count > 0) { - ShowPreviousInHistory(); - } + Action outTransitionFinishedHandler = null; + outTransitionFinishedHandler = (controller) => { + CurrentWindow = null; + if (windowQueue.Count > 0) + { + ShowNextInQueue(); + } + else if (windowHistory.Count > 0) + { + ShowPreviousInHistory(); + } + screen.OutTransitionFinished -= outTransitionFinishedHandler; + }; + screen.OutTransitionFinished += outTransitionFinishedHandler; } else { Debug.LogError(