예제 #1
0
    public void Save(ref WorldSerialization blob)
    {
        if (!HasValidTerrain())
        {
            return;
        }

        blob.world.size = (uint)Terrain.terrainData.size.x;

        byte[] byteArray = ArrayUtils.FloatToByteArray(Terrain.terrainData.GetHeights(0, 0, Terrain.terrainData.heightmapWidth, Terrain.terrainData.heightmapHeight));

        blob.AddMap("terrain", byteArray);
        blob.AddMap("height", byteArray);
        blob.AddMap("water", Water.GetBytes());
        blob.AddMap("splat", Splat.GetBytes());
        blob.AddMap("alpha", Alpha.GetBytes());
        blob.AddMap("biome", Biome.GetBytes());
        blob.AddMap("topology", Topology.GetBytes());
    }