Example #1
0
    private ProcGenChunk CreateTerrainChunk(Vector2 position)
    {
        ProcGenChunk chunk = Instantiate(landscapePrefab);

        chunk.InitInfiniteLandScape(material, xResolution, zResolution, meshScale, yScale, octaves, lacunarity, gain, perlinScale, position);
        chunk.transform.SetParent(transform);
        return(chunk);
    }
Example #2
0
    public void CreateMesh()
    {
        ProcGenChunk topLeft   = CreateTerrainChunk(new Vector2(0, 2 * zResolution));
        ProcGenChunk topMiddle = CreateTerrainChunk(new Vector2(xResolution, 2 * zResolution));
        ProcGenChunk topRight  = CreateTerrainChunk(new Vector2(2 * xResolution, 2 * zResolution));

        ProcGenChunk midLeft  = CreateTerrainChunk(new Vector2(0, zResolution));
        ProcGenChunk middle   = CreateTerrainChunk(new Vector2(xResolution, zResolution));
        ProcGenChunk midRight = CreateTerrainChunk(new Vector2(2 * xResolution, zResolution));

        ProcGenChunk bottomLeft   = CreateTerrainChunk(new Vector2(0, 0));
        ProcGenChunk bottomMiddle = CreateTerrainChunk(new Vector2(xResolution, 0));
        ProcGenChunk bottomRight  = CreateTerrainChunk(new Vector2(2 * xResolution, 0));
    }