aboutsummaryrefslogtreecommitdiff
path: root/td/Assets/Scripts/EnemySpawner.cs
diff options
context:
space:
mode:
authorJakob Stendahl <jakob.stendahl@outlook.com>2017-10-07 21:16:23 +0200
committerJakob Stendahl <jakob.stendahl@outlook.com>2017-10-07 21:16:23 +0200
commit69a6cc2555d8dfc8314a08e6cef6b67fa1177bf0 (patch)
treebe48ae23e1085c2522808af2d418c852998a8c58 /td/Assets/Scripts/EnemySpawner.cs
parente13fd4cf1fc0ad9eff857295fd5abc15ab01462c (diff)
downloadTD-69a6cc2555d8dfc8314a08e6cef6b67fa1177bf0.tar.gz
TD-69a6cc2555d8dfc8314a08e6cef6b67fa1177bf0.zip
Made projectiles, and working health system
Diffstat (limited to 'td/Assets/Scripts/EnemySpawner.cs')
-rw-r--r--td/Assets/Scripts/EnemySpawner.cs6
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);
}