Guest User

Untitled

a guest
Jun 4th, 2016
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1.  IEnumerator SpawnWaves()
  2.     {
  3.         yield return new WaitForSeconds(startWait);
  4.         while (true)
  5.         {
  6.             for (int i = 0; i != hazardCount; ++i)
  7.             {
  8.                 Vector3 spawnPosition = new Vector3(Random.Range(-spawnValue.x, spawnValue.x), spawnValue.y, spawnValue.z);
  9.                 Quaternion spawnRotation = Quaternion.identity;
  10.                 Instantiate(hazard, spawnPosition, spawnRotation);
  11.                 yield return new WaitForSeconds(spawnWait);
  12.             }
  13.             yield return new WaitForSeconds(waveWait);
  14.         }
  15.     }
Add Comment
Please, Sign In to add comment