From 6870630d8b99049cbd7f62728d568cc9a4de15a3 Mon Sep 17 00:00:00 2001 From: vylion Date: Sat, 29 Oct 2016 02:10:04 +0200 Subject: [PATCH] Edited UnitCreator to push new units to unit list --- Assets/UnitCreator.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Assets/UnitCreator.cs b/Assets/UnitCreator.cs index d47144e..d8a4451 100644 --- a/Assets/UnitCreator.cs +++ b/Assets/UnitCreator.cs @@ -7,7 +7,7 @@ public class UnitCreator : MonoBehaviour { public GameObject lichObject; public UnitBehaviour playerLich; public GameObject skeletonObject; - public GameObject[] units; + public List units; private UnitBehaviour script; @@ -19,7 +19,7 @@ public class UnitCreator : MonoBehaviour { // Use this for initialization void Start () { - units = new GameObject[0]; + units = new List (); } // Update is called once per frame @@ -40,6 +40,7 @@ public class UnitCreator : MonoBehaviour { } else if (type == UnitType.Skeleton) { GameObject skeleton; skeleton = Instantiate (skeletonObject, posVec3, Quaternion.identity); + units.Add (skeleton); } } }