Beispiel #1
0
    void SpawnNextBiome()
    {
        terrainMap.DisplayNextBiome();
        nextBiomeTimer = nextBiomeTimeDelay;

        EnemyConfiguration nextEnemyType = enemyTypes[UnityEngine.Random.Range(0, enemyTypes.Length)];
        GameObject         newEnemy      = (GameObject)Instantiate(nextEnemyType.Prefab);

        newEnemy.GetComponent <NavMeshAgent>().speed = nextEnemyType.speed;
        newEnemy.transform.position = terrainMap.GetRandomTileOnCurrentBiome().transform.position;
        newEnemy.transform.parent   = this.gameObject.transform;
        newEnemy.name = nextEnemyType.name;
        newEnemy.GetComponent <Enemy>().Health = 10;
    }
Beispiel #2
0
 public void OnDisplayBiome()
 {
     terrain.DisplayNextBiome();
 }