private void Init() { _oldSlice = Slice; _collection = new MaterialCollection(); var go = new GameObject("map"); _cloud = new ChunkCloud(_collection, go.transform); _cloud.StartBatch(); for (var x = -300; x < 300; x++) { for (var y = 0; y < 3; y++) { for (var z = -300; z < 300; z++) { _cloud.SetVoxel(TransparentMaterial, new Vector3Int(x, y, z)); } } } for (var x = -1; x < 1; x++) { for (var y = -1; y < 1; y++) { for (var z = -1; z < 1; z++) { _cloud.SetVoxel(OpaqueMaterial, new Vector3Int(x, y, z)); } } } _cloud.FinishBatch(); }
public World(MaterialCollection materialCollection) { _materialCollection = materialCollection; var go = new GameObject("map"); SolidChunks = new ChunkCloud(materialCollection, go.transform); FluidChunks = new FluidChunkCloud(materialCollection, go.transform); FluidUpdater = go.AddComponent <FluidUpdaterCloud>(); FluidUpdater.World = this; }
public void TestRenderIsInvisibleInside() { var collection = new MaterialCollection(); var go = new GameObject("map"); var cloud = new ChunkCloud(collection, go.transform); var start = new Vector3Int(-1, -1, -1); var end = new Vector3Int(1, 1, 1); for (var x = start.x; x < end.x; x++) { for (var y = start.y; y < end.y; y++) { for (var z = start.z; z < end.z; z++) { cloud.SetVoxel("glass", new Vector3Int(x, y, z)); } } } CheckBlockEmpty(start, end); }
public void TestRenderIsVisibleFromAllSides() { var collection = new MaterialCollection(); var go = new GameObject("map"); var cloud = new ChunkCloud(collection, go.transform); cloud.StartBatch(); var start = new Vector3Int(-30, -30, -30); var end = new Vector3Int(30, 30, 30); for (var x = start.x; x < end.x; x++) { for (var y = start.y; y < end.y; y++) { for (var z = start.z; z < end.z; z++) { cloud.SetVoxel("glass", new Vector3Int(x, y, z)); } } } cloud.FinishBatch(); CheckBlockRendered(start, end); }