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