Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public float spawnDelay;
- public float difficultyFactor = 1000;
- // Use this for initialization
- void Start () {
- StartCoroutine(spawnEnemies());
- }
- IEnumerator spawnEnemies()
- {
- int nbEnemies = Mathf.RoundToInt(Mathf.Sqrt(Time.time / difficultyFactor));
- for (int i = 0; i < nbEnemies; i++)
- {
- //SPAWN YOUR ENEMIE
- }
- yield return new WaitForSeconds(spawnDelay);
- StartCoroutine(spawnEnemies());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement