Exemplo n.º 1
0
    private void GetNextWave()
    {
        m_currentWaveIndex++;
        if (m_currentWaveIndex < m_waveCount)
        {
            m_currentWaveData = m_waveData.m_waveList[m_currentWaveIndex];
        }

        GetNextEnemyGroupOnNextWave();

        BroadcastOnNewWaveEvent();
    }
Exemplo n.º 2
0
    private void StartEnemySpawn()
    {
        if (m_waveData == null || m_waveData.m_waveList.Count == 0)
        {
            Debug.LogError("The wave list is null or empty!");
        }
        if (m_spawnPosition == null)
        {
            Debug.LogError("Spawn position is null or missing in the inspector!");
        }

        m_currentWaveIndex = 0;
        m_currentWaveData  = m_waveData.m_waveList[m_currentWaveIndex];
        m_waveCount        = m_waveData.m_waveList.Count;

        m_currentEnemyGroupIndex = 0;
        m_currentEnemyGroupData  = m_currentWaveData.m_enemyGroupList[m_currentEnemyGroupIndex];
        m_enemyGroupCount        = m_currentWaveData.m_enemyGroupList.Count;

        BroadcastOnNewWaveEvent();
        m_spawnCoroutine = StartCoroutine(SpawnDelay());
    }