Modified calls to IsCursorVisible

This commit is contained in:
SHAM-DP 2023-03-02 10:01:52 +08:00
parent a04eee0a2f
commit 4131c58c08
3 changed files with 5 additions and 4 deletions

View File

@ -84,6 +84,7 @@ public class GameManager : Script
AudioHandler.audioClipHandlers["SFXHumming"] = Audio.CreateAudioClip("event:/Homeowner/homeowner_humming"); AudioHandler.audioClipHandlers["SFXHumming"] = Audio.CreateAudioClip("event:/Homeowner/homeowner_humming");
AudioHandler.audioClipHandlers["SFXHumming"].SetVolume(0.15f); AudioHandler.audioClipHandlers["SFXHumming"].SetVolume(0.15f);
AudioHandler.audioClipHandlers["SFXHumming"].Play(); AudioHandler.audioClipHandlers["SFXHumming"].Play();
Application.IsCursorVisible = false;
} }
protected override void update() protected override void update()
@ -91,14 +92,13 @@ public class GameManager : Script
if (GamePause) if (GamePause)
{ {
Input.SetMouseCentering(false); Input.SetMouseCentering(false);
Application.IsCursorVisible = true; //Application.IsCursorVisible = true;
return; return;
} }
if (currGameState == GameState.START) if (currGameState == GameState.START)
{ {
Input.SetMouseCentering(true); Input.SetMouseCentering(true);
Application.IsCursorVisible = false;
timer -= Time.DeltaTimeF; timer -= Time.DeltaTimeF;
if(scoreText) if(scoreText)

View File

@ -16,6 +16,7 @@ public class EndScene : Script
protected override void start() protected override void start()
{ {
Input.SetMouseCentering(false); Input.SetMouseCentering(false);
Debug.Log("EndScene::Start():");
Application.IsCursorVisible = true; Application.IsCursorVisible = true;
} }

View File

@ -88,7 +88,7 @@ public class PauseMenu : Script
protected override void update() 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; GameManager.Instance.GamePause = true;
Input.SetMouseCentering(false); Input.SetMouseCentering(false);