Skip to content

Instantly share code, notes, and snippets.

@bitoffdev
Created November 10, 2013 05:12
Show Gist options
  • Save bitoffdev/7394103 to your computer and use it in GitHub Desktop.
Save bitoffdev/7394103 to your computer and use it in GitHub Desktop.
var tileSize : float = 10;
var roadSize : float = 4;
function BuildCity(rows:int, columns:int){
for (var i:int=1;i<=rows;i+=1){
for (var j:int=1;j<=columns;j+=1){
var citytile : GameObject = GameObject.CreatePrimitive(PrimitiveType.Plane);
citytile.transform.parent = transform;
citytile.transform.position = Vector3(i*(tileSize + roadSize),0,j*(tileSize + roadSize));
citytile.transform.localRotation = Quaternion.identity;
}
}
}
function Start(){
BuildCity(3,3);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment