Exemplo n.º 1
0
    public void Generate()
    {
        VoxelChunk chunk = VoxelChunk.Generate(dimensions, seed, noiseScale, octaves, persistence, lacunarity, offset);

        GetComponent <MeshFilter>().sharedMesh = GetComponent <MeshCollider>().sharedMesh = GenerateMesh(chunk.voxels);

        GetComponent <MeshRenderer>().material = new Material(Shader.Find("Legacy Shaders/Diffuse"))
        {
            mainTexture = GenerateTexture(chunk.NoiseMap)
        };
    }