示例#1
0
    void MeshDataThread(MapData mapData, Action <MeshData> callBack)
    {
        MeshData meshData = MeshGen.GenTerrain(mapData.heightMap, meshHeightMultipler, meshHeightCurve, levelOfDetail);

        lock (meshThreadInfoQueue)
        {
            meshThreadInfoQueue.Enqueue(new MapThreadInfo <MeshData>(callBack, meshData));
        }
    }
示例#2
0
    public void DrawingInEditor()
    {
        MapData mapData = GenMapData();

        //referenceing MapDisplay & TextureGen for noise and color with width & height
        MapDisplay display = FindObjectOfType <MapDisplay>();

        if (drawMode == DrawMode.NoiseMap)
        {
            display.DrawTexture(TextureGen.TextureFromHeight(mapData.heightMap));
        }
        else if (drawMode == DrawMode.ColorMap)
        {
            display.DrawTexture(TextureGen.TextureFromMap(mapData.colorMap, mapChunkSize, mapChunkSize));
        }
        else if (drawMode == DrawMode.Mesh)
        {
            display.DrawMesh(MeshGen.GenTerrain(mapData.heightMap, meshHeightMultipler, meshHeightCurve, levelOfDetail),
                             TextureGen.TextureFromMap(mapData.colorMap, mapChunkSize, mapChunkSize));
        }
    }