diff options
author | Jakob Stendahl <jakob.stendahl@outlook.com> | 2017-10-13 22:11:33 +0200 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2017-10-13 22:11:33 +0200 |
commit | d77cd51742cb760f5f2e8f5f3c283e311ffffe1c (patch) | |
tree | a60aaccbbe51c2202e596c22d3741370fdc357d2 /td/Assets/Scripts/Enemy.cs | |
parent | 112a91b7084a5365291c712fabcb8ceeb4c644ce (diff) | |
download | TD-d77cd51742cb760f5f2e8f5f3c283e311ffffe1c.tar.gz TD-d77cd51742cb760f5f2e8f5f3c283e311ffffe1c.zip |
Added new method for pausing the game
Diffstat (limited to 'td/Assets/Scripts/Enemy.cs')
-rw-r--r-- | td/Assets/Scripts/Enemy.cs | 2 |
1 files changed, 2 insertions, 0 deletions
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); |