Fade in when shift starts, fixed fadeout canceling before screen is switched to lobby

This commit is contained in:
Regalis
2016-01-20 23:22:55 +02:00
parent 6f537ebc7c
commit 2761c4a610
5 changed files with 47 additions and 13 deletions
+12 -2
View File
@@ -54,6 +54,14 @@ namespace Barotrauma
while (timer < duration)
{
if (Screen.Selected != GameMain.GameScreen)
{
yield return new WaitForSeconds(0.1f);
GUI.ScreenOverlayColor = Color.TransparentBlack;
yield return CoroutineStatus.Success;
}
cam.Zoom = Math.Max(0.2f, cam.Zoom - CoroutineManager.DeltaTime * 0.1f);
Vector2 cameraPos = sub.Position + Submarine.HiddenSubPosition;
@@ -73,10 +81,12 @@ namespace Barotrauma
yield return CoroutineStatus.Running;
}
GUI.ScreenOverlayColor = Color.TransparentBlack;
Running = false;
yield return new WaitForSeconds(0.1f);
GUI.ScreenOverlayColor = Color.TransparentBlack;
yield return CoroutineStatus.Success;
}
}