From 69a6cc2555d8dfc8314a08e6cef6b67fa1177bf0 Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Sat, 7 Oct 2017 21:16:23 +0200 Subject: Made projectiles, and working health system --- td/Assets/Scripts/EnemySpawner.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'td/Assets/Scripts/EnemySpawner.cs') diff --git a/td/Assets/Scripts/EnemySpawner.cs b/td/Assets/Scripts/EnemySpawner.cs index 74dc243..ee0d3d6 100644 --- a/td/Assets/Scripts/EnemySpawner.cs +++ b/td/Assets/Scripts/EnemySpawner.cs @@ -9,7 +9,10 @@ public class EnemySpawner : MonoBehaviour { public Enemy enemyPrefab; public Transform pathWay; - Transform parentObject; + [Header("Scripting vars")] + public player player; // Reference to the player object, should be set when instantiating + + private Transform parentObject; List waypoints = new List(); int next = 1; @@ -38,6 +41,7 @@ public class EnemySpawner : MonoBehaviour { script.waypoints = waypoints; script.speed = Random.Range (0.3f, 1.2f); + script.player = player; transform.position = new Vector3 (0.93f, 0.483f, 0f); } -- cgit v1.2.3