/// <summary> /// Rebuild the voxel mesh. /// </summary> public void RefreshMesh() { int size = this.Height + (this.Height -1); int modify_size = size; Color32 empty = new Color32(0, 0, 0, 255); ArrayVoxelMesh pyramid = new ArrayVoxelMesh(size, size, size); for (int y = 0; y < this.Height; ++y) { for (int x = size - modify_size; x < modify_size; ++x) { for (int z = size - modify_size; z < modify_size; ++z) { Vector3 point = this.GetPoint(x, y, z); pyramid[x, y, z] = this.Color; } } modify_size -= 1; } this.Mesh = pyramid; }
/// <summary> /// Rebuild the voxel mesh. /// </summary> public void RefreshMesh() { int width = this.Width; int height = this.Height; int depth = this.Depth; Color32 empty = new Color32(0, 0, 0, 255); ArrayVoxelMesh parallelepiped = new ArrayVoxelMesh(width, height, depth); for (int x = 0; x < width; ++x) { for (int y = 0; y < height; ++y) { for (int z = 0; z < depth; ++z) { parallelepiped[x, y, z] = this.Color; } } } this.Mesh = parallelepiped; }