From c118ec136fc3fa22d00121bc0ad1cae6f9f1f467 Mon Sep 17 00:00:00 2001 From: Glence Date: Sun, 5 Mar 2023 21:23:41 +0800 Subject: [PATCH] Call centering of mouse at the correct place and default DT on awake --- Assets/Scripts/Gameplay/SC_GameManager.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/Gameplay/SC_GameManager.cs b/Assets/Scripts/Gameplay/SC_GameManager.cs index e654bd99..5dd743d1 100644 --- a/Assets/Scripts/Gameplay/SC_GameManager.cs +++ b/Assets/Scripts/Gameplay/SC_GameManager.cs @@ -79,6 +79,10 @@ public class GameManager : Script scoreText.GetComponent().Text = $"{Score}"; if (timeText) timeText.GetComponent().Text = $"{timer.ToString("0")}"; + + Input.SetMouseCentering(true); + Application.IsCursorVisible = false; + Application.FixDeltaTime = Time.DefaultFixDeltaTime; } protected override void start() @@ -93,7 +97,6 @@ public class GameManager : Script if (SceneFadeInOut.Instance != null) SceneFadeInOut.Instance.CallFadeOut(); - Application.IsCursorVisible = false; GamePause = false; } @@ -102,15 +105,11 @@ public class GameManager : Script { if (GamePause || !stealFoodPopUpDone) { - Input.SetMouseCentering(false); - Application.IsCursorVisible = true; return; } if (currGameState == GameState.START) - { - Input.SetMouseCentering(true); - + { timer -= Time.DeltaTimeF; if(scoreText) scoreText.GetComponent().Text = $"{Score}";