From fae01da58dbea66af402807d7409fa53602f71fa Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Sat, 14 Oct 2017 22:07:19 +0200 Subject: Finished wavesystem. Should improve graph for how many enemies should spawn each time --- 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 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 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; -- cgit v1.2.3