aboutsummaryrefslogtreecommitdiff
path: root/td/Assets/Scripts/Enemy.cs
diff options
context:
space:
mode:
Diffstat (limited to 'td/Assets/Scripts/Enemy.cs')
-rw-r--r--td/Assets/Scripts/Enemy.cs2
1 files changed, 2 insertions, 0 deletions
diff --git a/td/Assets/Scripts/Enemy.cs b/td/Assets/Scripts/Enemy.cs
index 20436db..4d15b64 100644
--- a/td/Assets/Scripts/Enemy.cs
+++ b/td/Assets/Scripts/Enemy.cs
@@ -10,6 +10,7 @@ public class Enemy : MonoBehaviour {
public int InitialHp; // HealthPoints
public int Damage;
public List<Vector3> Waypoints; // Pathway waypoints, should be set by the spawner
+
[Header("Scripting vars")]
public Player Player; // Reference to the player object, should be set when instantiating
@@ -29,6 +30,7 @@ public class Enemy : MonoBehaviour {
// Selfdestruct if object reached the end
if (_waypointNum + 1 >= Waypoints.Count) {
+ WaveSpawner.EnemiesAlive--;
Player.DecreaseHealth (Damage);
Destroy (gameObject);
return;