Created
November 10, 2013 05:12
-
-
Save bitoffdev/7394103 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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