protected virtual void Spawn() { foreach (SpawnPoint sp in spawnPoints) { for (int i = 0; i < sp.enemyIDs.Length; i++) { GameObject enemy = GameObject.Instantiate(enemyTypes [sp.enemyIDs [i]], transform); enemy.transform.position = sp.transform.position + (Vector3)sp.spawnOffsets [i]; AIEntity entity = enemy.GetComponent <AIEntity> (); entity.Setup(); entity.stats.ModifyStatsByFactor(AIController.GetDifficultyModifier()); spawnedEntities.Add(entity); AIController.AddSpawner(this); } } // Deactivate spawner collider to prevent respawning // Realize future SpawnerControllers can inherit from SpawnerController and override Spawn() GetComponent <Collider2D> ().enabled = false; }