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(