Ejemplo n.º 1
0
    void MeshDataThread(MapData mapData, int lod, Action <MeshData> callback)
    {
        MeshData meshData = MeshGen.GennerateTerrainMesh(mapData.heightMap, meshHeight, meshHeightCurve, lod);

        lock (MeshDataInfoQueue)
        { MeshDataInfoQueue.Enqueue(new MapThreadInfo <MeshData>(callback, meshData)); }
    }
Ejemplo n.º 2
0
    private void Start()
    {
        Map     map     = FindObjectOfType <Map>();
        MapData mapdata = GenThatMapData(Vector2.zero);

        if (drawMode == DrawMode.DrawMesh)
        {
            map.DrawMesh(MeshGen.GennerateTerrainMesh(mapdata.heightMap, meshHeight, meshHeightCurve, editorlevelOfDetail), TextureGen.TextureFromColorMap(mapdata.colorMap, mapChunkSize, mapChunkSize));
        }
    }
Ejemplo n.º 3
0
    public void DrawMapInEditor()
    {
        MapData mapdata = GenThatMapData(Vector2.zero);
        Map     map     = FindObjectOfType <Map>();

        if (drawMode == DrawMode.NoiseMap)
        {
            map.DrawTexture(TextureGen.TextureFromHeightMap(mapdata.heightMap));
        }
        else if (drawMode == DrawMode.ColorMap)
        {
            map.DrawTexture(TextureGen.TextureFromColorMap(mapdata.colorMap, mapChunkSize, mapChunkSize));
        }
        else if (drawMode == DrawMode.DrawMesh)
        {
            map.DrawMesh(MeshGen.GennerateTerrainMesh(mapdata.heightMap, meshHeight, meshHeightCurve, editorlevelOfDetail), TextureGen.TextureFromColorMap(mapdata.colorMap, mapChunkSize, mapChunkSize));
        }
        else if (drawMode == DrawMode.FallOffMap)
        {
            map.DrawTexture(TextureGen.TextureFromHeightMap(FalloffMapGenerator.GenerateFalloffMapp(mapChunkSize)));
        }
    }