Game Development Reference
In-Depth Information
for(var row:int = 1; row <= numRows; row++)
{
for(var col:int = 1; col <= numCols; col++)
{
aP = GameObject.
CreatePrimitive(PrimitiveType.Cube);
aP.transform.position.x = col * 2;
aP.transform.position.y = row * 2;
}
}
}
Fig 1.29 A column and row of cubes created entirely with script.
Step 12. Save and play to see the matrix of cubes as shown in
Figure 1.30 .
Search Nedrilad ::




Custom Search