void spawnBoss() { EnemySpawnTemplate boss_enemy = GameObject.FindGameObjectWithTag("AllRooms").GetComponent <EnemySpawnTemplate> (); rand = Random.Range(0, boss_enemy.enemies.Length); Instantiate(boss_enemy.enemies [rand], transform.position, Quaternion.identity).transform.localScale = new Vector3(1.5f, 1.5f, 0f); }
void spawnEnemies() { // If the player enters the bounding box of the room, instatiate // a random enemy spawner layout from RoomTemplate, and destroy the // room spawner object enemy_templates = GameObject.FindGameObjectWithTag("AllRooms").GetComponent <EnemySpawnTemplate> (); rand = Random.Range(0, enemy_templates.spLayouts.Length); Instantiate(enemy_templates.spLayouts [rand], transform.position, Quaternion.identity); }
//private bool spawned = false; void Start() { Destroy(gameObject, 4f); templates = GameObject.FindGameObjectWithTag("AllRooms").GetComponent <EnemySpawnTemplate> (); Invoke("Spawn", 0.4f); }