예제 #1
0
    private void Spawn()
    {
        m_currentIndex++;
        WaveElement element = m_waveElements[m_currentIndex];

        // Get Zone
        SpawnZone zone = SpawnZoneConfiguration.Instance.Zones.Find(z => z.Tag == element.SpawnZone);

        // Spawn object
        m_lastSpawned = Instantiate(element.UnitPrefab, zone.GetRandomPointInZone(), Quaternion.identity);

        m_lastSpawnTime = Time.time;
        m_nextSpawn     = Time.time + element.TimeBeforeNext;
    }