MobVolumeChange()

Found in:

public void MobVolumeChange(int mobID, int mobVolChange)
    {
        if (mobID < 0) return;

        Random.InitState(Time.captureFramerate);

        int randSpawn = Random.Range(0, mobSpawns.Count);
        GameObject dummyEnemyObj;

        if (mobVolChange < 0 & enemyConcentrationDict[mobID] + mobVolChange < levelMobVolLimits[mobID]) // Enemy died, wait then add new
        {
            methodPause = WaitInterval(2f);
            enemyConcentrationDict[mobID]--;

            StartCoroutine(methodPause);

            // Come back later and reassess the need to add the same enemy here

            enemyConcentrationDict[mobID]++;
            dummyEnemyObj = Instantiate(SpawnMob(mobID), mobSpawns[randSpawn].transform.position, Quaternion.identity);

            StopCoroutine(methodPause);
            methodPause = null;
            
        }
        else if (mobVolChange > 0 & enemyConcentrationDict[mobID] + mobVolChange < levelMobVolLimits[mobID]) // Enemy created, assess vol limit 
        {
            enemyConcentrationDict[mobID] += mobVolChange;
            Instantiate(SpawnMob(mobID), mobSpawns[randSpawn].transform.position, Quaternion.identity);
        }

        // This should be the spawn group option
    }


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *