コード例 #1
0
        private static void FillRuinColumn(ChunkGeneratorSettings Settings, MaybeNull <VoxelType> WallType, int gap, int wallHeight, VoxelHandle baseVoxel, float decay)
        {
            for (int dy = gap; dy < wallHeight * (1.0f - decay) && dy < (Settings.WorldSizeInChunks.Y * VoxelConstants.ChunkSizeY) - 2; dy++)
            {
                var currVoxel = Settings.World.ChunkManager.CreateVoxelHandle(baseVoxel.Coordinate + new GlobalVoxelOffset(0, dy, 0));

                if (currVoxel.IsValid)
                {
                    currVoxel.RawSetType(WallType);
                }
            }
        }
コード例 #2
0
        private static void FillBelowRuins(ChunkGeneratorSettings Settings, MaybeNull <VoxelType> ruinWallType, VoxelHandle baseVoxel, VoxelHandle underVoxel)
        {
            for (int dy = 1; dy < (baseVoxel.Coordinate.Y - underVoxel.Coordinate.Y); dy++)
            {
                var currVoxel = Settings.World.ChunkManager.CreateVoxelHandle(underVoxel.Coordinate + new GlobalVoxelOffset(0, dy, 0));

                if (!currVoxel.IsValid)
                {
                    continue;
                }

                currVoxel.RawSetType(ruinWallType);
            }

            underVoxel.RawSetGrass(0);
        }