Esempio n. 1
0
    private void EndRoundFunction()
    {
        m_eCurrentGameState = eGAMESTATES.MIDROUND;//only run once, set gamestate
        m_iCurrentRound    += 1;
        m_tRoundText.text   = "Round: " + m_iCurrentRound.ToString();

        m_iMaxEnemies = (int)(Mathf.Pow(m_iCurrentRound, 2) * m_fSpawnMultiplier) + m_iBaseNumberOfAgentsPerRound;                   //Calculate new zombie amount for next round

        m_fSpawnDelay = Mathf.Clamp((m_fBaseAgentSpawnDelay - (Mathf.Pow(m_iCurrentRound, m_fDelayDecayMultiplier))), 0.5f, 100.0f); //Calculate new zombie spawn delay

        m_iSpawnedAgents = 0;
    }
Esempio n. 2
0
    private void MidRoundFunction()
    {
        m_iCurrentAgents = FindObjectsOfType <CS_AIBase>().Length;
        if (CheckSpawnTimer() &&
            (m_iCurrentAgents < m_iMaxEnemies) &&
            (m_iCurrentAgents < m_fMaxAgentsAllowedOnMap) &&
            (m_iSpawnedAgents <= m_iMaxEnemies))
        {
            SpawnAgent();
        }
        else
        {
            m_fTimeSinceLastSpawn += Time.deltaTime;
        }

        if (m_iSpawnedAgents >= m_iMaxEnemies && m_iCurrentAgents <= 0)
        {
            m_eCurrentGameState = eGAMESTATES.ENDROUND;
        }
        //m_tRoundText.text = m_iCurrentRound.ToString();
    }
Esempio n. 3
0
 // Start is called before the first frame update
 private void Start()
 {
     m_eCurrentGameState = eGAMESTATES.ENDROUND;
     m_fSpawnDelay       = m_fBaseAgentSpawnDelay;
 }