From d77cd51742cb760f5f2e8f5f3c283e311ffffe1c Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Fri, 13 Oct 2017 22:11:33 +0200 Subject: Added new method for pausing the game --- td/Assets/Scripts/cameraHandler.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'td/Assets/Scripts/cameraHandler.cs') diff --git a/td/Assets/Scripts/cameraHandler.cs b/td/Assets/Scripts/cameraHandler.cs index 1655509..7c2f75f 100644 --- a/td/Assets/Scripts/cameraHandler.cs +++ b/td/Assets/Scripts/cameraHandler.cs @@ -11,6 +11,8 @@ public class CameraHandler : MonoBehaviour { public static readonly float[] BoundsY = new float[]{-5f, 10f}; public static readonly float[] BoundsZ = new float[]{-8f, 8f}; public static readonly float[] ZoomBounds = new float[]{1f, 5f}; + [Header("Scripting vars")] + public Player Player; // Reference to the player object, should be set in designer private Camera _cam; @@ -26,6 +28,7 @@ public class CameraHandler : MonoBehaviour { } void Update() { + if (Player.GameIsPaused()) { return; } // If there's an open menu, or the clicker is being pressed, ignore the touch. /* if (GameManager.Instance.MenuManager.HasOpenMenu || GameManager.Instance.BitSpawnManager.IsSpawningBits) { -- cgit v1.2.3