diff options
Diffstat (limited to 'td/Assets/Scripts/EnemySpawner.cs')
-rw-r--r-- | td/Assets/Scripts/EnemySpawner.cs | 6 |
1 files changed, 5 insertions, 1 deletions
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<Vector3> waypoints = new List<Vector3>(); 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); } |