コード例 #1
0
 private IEnumerator SpawnAllEnemiesInWave(GC_WaveConfig waveConfig)
 {
     for (int enemyCount = 0; enemyCount < waveConfig.GetNUmberOfEnemies(); enemyCount++)
     {
         var newEnemy = Instantiate(
             waveConfig.GetEnemyPrefab(),
             waveConfig.GetWaypoints()[0].transform.position,
             Quaternion.identity);
         newEnemy.GetComponent <GC_EnemyPathing>().SetWaveConfig(waveConfig);
         yield return(new WaitForSeconds(waveConfig.GetTimeBetweenSpawns()));
     }
 }
コード例 #2
0
 // Start is called before the first frame update
 void Start()
 {
     waypoints          = waveConfig.GetWaypoints();
     transform.position = waypoints[waypointIndex].transform.position;
 }