Advertisement
LittleAngel

120912 GameController

Sep 12th, 2012
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #pragma strict
  2.  
  3. var enemy : GameObject;
  4. var enemyCount : int;
  5.  
  6. function Start () {
  7. StartCoroutine (SpawnWaves());
  8. }
  9.  
  10. function SpawnWaves () {
  11. yield WaitForSeconds (1.0);
  12.  
  13. for (var i : int = 0; i < enemyCount; i++) {
  14. var spawnPosition = Vector3 (Random.Range (-8.5, 8.5), 0.0, 25.0);
  15. Instantiate(enemy, spawnPosition, Quaternion.identity);
  16. yield WaitForSeconds (0.5);
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement