Implemented mouse centering and hiding in game #384
|
@ -95,7 +95,8 @@ public class GameManager : Script
|
|||
AudioHandler.audioClipHandlers["SFXHumming"].SetVolume(0.15f);
|
||||
AudioHandler.audioClipHandlers["SFXHumming"].Play();
|
||||
|
||||
SceneFadeInOut.Instance.CallFadeOut();
|
||||
if (SceneFadeInOut.Instance != null)
|
||||
SceneFadeInOut.Instance.CallFadeOut();
|
||||
Application.IsCursorVisible = false;
|
||||
}
|
||||
|
||||
|
@ -143,7 +144,8 @@ public class GameManager : Script
|
|||
AudioHandler.StopAllSounds(false);
|
||||
AudioHandler.audioClipHandlers["BGMWin"].Play();
|
||||
goingToWin = true;
|
||||
SceneFadeInOut.Instance.CallFadeIn();
|
||||
if (SceneFadeInOut.Instance != null)
|
||||
SceneFadeInOut.Instance.CallFadeIn();
|
||||
}
|
||||
else if(!goingToWin && (timer < 0 || Input.GetKeyDown(Input.KeyCode.F2)))
|
||||
{
|
||||
|
@ -151,12 +153,27 @@ public class GameManager : Script
|
|||
AudioHandler.StopAllSounds(false);
|
||||
AudioHandler.audioClipHandlers["BGMLose"].Play();
|
||||
goingToLose = true;
|
||||
SceneFadeInOut.Instance.CallFadeIn();
|
||||
if (SceneFadeInOut.Instance != null)
|
||||
SceneFadeInOut.Instance.CallFadeIn();
|
||||
}
|
||||
}
|
||||
|
||||
//Handling transitions
|
||||
if (SceneFadeInOut.Instance.FadeInFinished())
|
||||
if (SceneFadeInOut.Instance != null)
|
||||
{
|
||||
if (SceneFadeInOut.Instance.FadeInFinished())
|
||||
{
|
||||
if (goingToWin)
|
||||
{
|
||||
SceneManager.ChangeScene(winScene);
|
||||
}
|
||||
if (goingToLose)
|
||||
{
|
||||
SceneManager.ChangeScene(loseScene);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (goingToWin)
|
||||
{
|
||||
|
|
|
@ -13,7 +13,8 @@ public class PauseMenu : Script
|
|||
|
||||
protected override void awake()
|
||||
{
|
||||
GameManager.Instance.GamePause = false;
|
||||
if (GameManager.Instance != null)
|
||||
GameManager.Instance.GamePause = false;
|
||||
|
||||
if (canvas)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue