本文整理汇总了C#中Cube.GetLength方法的典型用法代码示例。如果您正苦于以下问题:C# Cube.GetLength方法的具体用法?C# Cube.GetLength怎么用?C# Cube.GetLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cube
的用法示例。
在下文中一共展示了Cube.GetLength方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateRenderableCubes
CubeMesh[,,] GenerateRenderableCubes(Cube[,,] cubes) {
var cubeMeshes = new CubeMesh[cubes.GetLength(0), cubes.GetLength(1), cubes.GetLength(2)];
var visualVertexCount = 0;
var collisionVertexCount = 0;
var begin = gridPosition * dimensionsInCubes;
var end = begin + dimensionsInCubes;
for (var cubeX = begin.x; cubeX < end.x; ++cubeX) {
for (var cubeY = begin.y; cubeY < end.y; ++cubeY) {
for (var cubeZ = begin.z; cubeZ < end.z; ++cubeZ) {
var cube = cubes[cubeX, cubeY, cubeZ];
if (cube == null) continue;
var cubeGridPosition = new Vector3i(cubeX, cubeY, cubeZ);
var cubeMesh = CalculateRenderableCube(cube, ref visualVertexCount, ref collisionVertexCount, cubes, cubeGridPosition);
cubeMeshes[cubeX, cubeY, cubeZ] = cubeMesh;
cubes[cubeX, cubeY, cubeZ] = cube;
}
}
}
return cubeMeshes;
}