Пример #1
0
    void MeshDataThread(MapData mapData, int lod, Action <MeshData> callback)
    {
        MeshData meshData =
            MRMeshGenerator.GenerateTerrainMesh(mapData.heightMap, meshHeightMultiplier, meshHeightCurve, lod);

        lock (meshDataThreadInfoQueue)
        {
            meshDataThreadInfoQueue.Enqueue(new MapThreadInfo <MeshData>(callback, meshData));
        }
    }
Пример #2
0
    public void DrawMapInEditor()
    {
        MapData mapData = GenerateMapData(Vector2.zero);

        MRMapDisplay display = FindObjectOfType <MRMapDisplay>();

        if (drawMode == DrawMode.NoiseMap)
        {
            display.DrawTexture(MRTextureGenerator.TextureFromHeightMap(mapData.heightMap));
        }
        else if (drawMode == DrawMode.ColourMap)
        {
            display.DrawTexture(MRTextureGenerator.TextureFromeColorMap(mapData.colorMap, mapChunkSize, mapChunkSize));
        }
        else if (drawMode == DrawMode.Mesh)
        {
            display.DrawMesh(MRMeshGenerator.GenerateTerrainMesh(mapData.heightMap, meshHeightMultiplier, meshHeightCurve, editorPreviewLOD), MRTextureGenerator.TextureFromeColorMap(mapData.colorMap, mapChunkSize, mapChunkSize));
        }
    }