Implemented mouse centering and hiding in game #384
|
@ -84,6 +84,7 @@ public class GameManager : Script
|
|||
AudioHandler.audioClipHandlers["SFXHumming"] = Audio.CreateAudioClip("event:/Homeowner/homeowner_humming");
|
||||
AudioHandler.audioClipHandlers["SFXHumming"].SetVolume(0.15f);
|
||||
AudioHandler.audioClipHandlers["SFXHumming"].Play();
|
||||
Application.IsCursorVisible = false;
|
||||
}
|
||||
|
||||
protected override void update()
|
||||
|
@ -91,15 +92,14 @@ public class GameManager : Script
|
|||
if (GamePause)
|
||||
{
|
||||
Input.SetMouseCentering(false);
|
||||
Application.IsCursorVisible = true;
|
||||
//Application.IsCursorVisible = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (currGameState == GameState.START)
|
||||
{
|
||||
Input.SetMouseCentering(true);
|
||||
Application.IsCursorVisible = false;
|
||||
|
||||
|
||||
timer -= Time.DeltaTimeF;
|
||||
if(scoreText)
|
||||
scoreText.GetComponent<TextRenderable>().Text = $"Score: {Score}";
|
||||
|
|
|
@ -16,6 +16,7 @@ public class EndScene : Script
|
|||
protected override void start()
|
||||
{
|
||||
Input.SetMouseCentering(false);
|
||||
Debug.Log("EndScene::Start():");
|
||||
Application.IsCursorVisible = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ public class PauseMenu : Script
|
|||
protected override void update()
|
||||
{
|
||||
|
||||
if (Input.GetKeyDown(Input.KeyCode.Escape) && !GameManager.Instance.GamePause)
|
||||
if (Input.GetKeyUp(Input.KeyCode.Escape) && !GameManager.Instance.GamePause)
|
||||
{
|
||||
GameManager.Instance.GamePause = true;
|
||||
Input.SetMouseCentering(false);
|
||||
|
|
Loading…
Reference in New Issue