Ejemplo n.º 1
0
    public void GenerateTerrain()
    {
        MultiTerrain multiTerrain = new MultiTerrain(30, 40, 129, 129);

        TerrainHeightGenerator heightGenerator = new TerrainHeightGenerator(.15f);
        var heights = heightGenerator.GenerateHeights();

        multiTerrain.SetHeights(heights);

        TerrainTextureGenerator textureGenerator = new TerrainTextureGenerator();
        var splatmap = textureGenerator.GenerateSplatmap();

        multiTerrain.SetSplatmapData(splatmap);

        treeManager = new TreeManager(multiTerrain, 50000);
        treeManager.SetTrees(player.transform.position, false);

        StartCoroutine("RedoTrees");
    }
Ejemplo n.º 2
0
 public TreeManager(MultiTerrain terrain, int treeCount)
 {
     this.terrain   = terrain;
     this.treeCount = treeCount;
     GenerateTreePool();
 }