// Update is called once per frame void Update() { if (wait == false) { timePassed += Time.deltaTime; if (timePassed > waveDuration) { try { StartCoroutine(UpdateWave()); } catch { } enemySpawner.Add(); bulletSpawner.Add(); timePassed = 0f; } } }