本文整理汇总了C#中Grid.Height方法的典型用法代码示例。如果您正苦于以下问题:C# Grid.Height方法的具体用法?C# Grid.Height怎么用?C# Grid.Height使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Grid
的用法示例。
在下文中一共展示了Grid.Height方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Grid_WidthHeight
public void Grid_WidthHeight()
{
Grid g = new Grid(256, 256);
Assert.AreEqual(256, g.Width());
Assert.AreEqual(256, g.Height());
}
示例2: Start
// Use this for initialization
void Start()
{
GameObject startCube = GameObject.CreatePrimitive(PrimitiveType.Cube);
startCube.transform.localScale = new Vector3 (150,1,150);
startCube.tag = "GenSection";
startCube.transform.position = new Vector3(transform.position.x + startCube.transform.localScale.x/2,
transform.position.y,
transform.position.z + startCube.transform.localScale.z/2);
levelGrid = new Grid((int) startCube.transform.localScale.x,(int) startCube.transform.localScale.z);
for (int i = 0; i < levelGrid.Width(); i++){
for (int j = 0; j < levelGrid.Height(); j++){
levelGrid.setTile(i,j,0);
}
}
parentNode = new BSPNode();
parentNode.setCube(startCube);
for (int i = 0; i < 7; i++){
split (parentNode);
}
//create the rooms
createRooms(parentNode);
//connect the rooms
connectRooms(parentNode);
//tidy up dungeon
for (int k = 0; k < 5; k++){
for (int i = 0; i < levelGrid.Width(); i++){
for (int j = 0; j < levelGrid.Height(); j++){
removeSingles(i,j);
}
}
}
createLevel();
}