Edited UnitCreator to push new units to unit list

This commit is contained in:
vylion 2016-10-29 02:10:04 +02:00
parent c4a5659c35
commit 6870630d8b

View file

@ -7,7 +7,7 @@ public class UnitCreator : MonoBehaviour {
public GameObject lichObject;
public UnitBehaviour playerLich;
public GameObject skeletonObject;
public GameObject[] units;
public List<GameObject> 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<GameObject> ();
}
// 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);
}
}
}