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/Enemy.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'td/Assets/Scripts/Enemy.cs') diff --git a/td/Assets/Scripts/Enemy.cs b/td/Assets/Scripts/Enemy.cs index 3074003..20436db 100644 --- a/td/Assets/Scripts/Enemy.cs +++ b/td/Assets/Scripts/Enemy.cs @@ -17,6 +17,8 @@ public class Enemy : MonoBehaviour { private int _waypointNum = -1; // Using minus one so that first addition returns 0, first element in array void Update () { + if (Player.GameIsPaused()) { return; } // This ensures that the game stays paused + if ( (transform.position == _waypointPos && _waypointNum + 1 < Waypoints.Count) || _waypointNum == -1) { _waypointNum++; _waypointPos = new Vector3 (Waypoints [_waypointNum].x, 0.483f, Waypoints [_waypointNum].z); -- cgit v1.2.3