示例#1
0
        void OnWorldInfoReceived(WorldStats worldStats)
        {
            this.worldStats   = worldStats;
            WorldInfoRecieved = true;

            Texture2D texture2D = Texturing.TextureFromColourMap(worldStats.colourWorld, WorldGenerator.worldPartSize, WorldGenerator.worldPartSize);

            meshRenderer.material.mainTexture = texture2D;

            UpdateTerrainChunk();
        }
示例#2
0
    public void RendWorld()
    {
        WorldStats   worldStats = GenerateWorld(Vector2.zero);
        WorldDisplay display    = FindObjectOfType <WorldDisplay>();

        if (drawMode == DrawMode.NoiseWorld)
        {
            display.DrawTexture(Texturing.TextureFromHeightMap(worldStats.heightWorld));
        }
        else if (drawMode == DrawMode.ColourWorld)
        {
            display.DrawTexture(Texturing.TextureFromColourMap(worldStats.colourWorld, worldPartSize, worldPartSize));
        }
        else if (drawMode == DrawMode.Mesh)
        {
            display.DrawMesh(MeshGenerator.GenerateTerrainMesh(worldStats.heightWorld, meshHeightMultiplier, meshHeightCurve, ValueLevelOfDetail), Texturing.TextureFromColourMap(worldStats.colourWorld, worldPartSize, worldPartSize));
        }
        else if (drawMode == DrawMode.FallMap)
        {
            display.DrawTexture(Texturing.TextureFromHeightMap(FallGenerator.GenerateFall(worldPartSize)));
        }
    }