Example #1
0
 void TestFillVoxels()
 {
     // Test
     m_WorldData.SetBlock(0, 0, 0, (byte)BlockType.Solid);
     m_WorldData.SetBlock(1, 1, 1, (byte)BlockType.Solid);
     m_WorldData.SetBlock(1, 2, 1, (byte)BlockType.Solid);
     m_WorldData.SetBlock(2, 2, 2, (byte)BlockType.Solid);
 }
Example #2
0
        public override void BuildWorldChunk(WorldData world, Chunk chunk)
        {
            IntVec3 size = world.ChunkSizeBlocks;

            for (int x = 0; x < size.x; x++)
            {
                for (int z = 0; z < size.z; z++)
                {
                    int height = Random.Range(1, 10);
                    for (int y = 0; y < height; y++)
                    {
                        world.SetBlock(
                            x + chunk.WorldPos.x,
                            y + chunk.WorldPos.y,
                            z + chunk.WorldPos.z,
                            m_SolidBlock);
                    }
                }
            }
        }