Advertisement
kasru

Create Grid

Mar 8th, 2013
4,489
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //****** Donations are greatly appreciated.  ******
  2. //****** You can donate directly to Jesse through paypal at  https://www.paypal.me/JEtzler   ******
  3.  
  4. var block1 : GameObject;
  5. var worldWidth : uint  = 100;
  6. var worldHeight : uint  = 100;
  7. var spawnSpeed : float = 1;
  8.  
  9. function Start () {
  10.     CreateWorld();
  11. }
  12.  
  13. function Update () {
  14. }
  15.  
  16. function CreateWorld() {
  17.    
  18.     yield WaitForSeconds(spawnSpeed);
  19.         for(var x : uint =0; x<worldWidth; x+=10) {
  20.         yield WaitForSeconds(spawnSpeed);
  21.         for(var z : uint =0; z<worldHeight; z+=10) {
  22.                 yield WaitForSeconds(spawnSpeed);
  23.                 var block = Instantiate(block1);
  24.           block.transform.position = new Vector3(this.transform.position.x + x, this.transform.position.y, this.transform.position.z + z);
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement