Skip to content

yoeven/Low_Poly_Procedural_Trees_and_Vegetations_Project

Repository files navigation

A simple low poly procedural tree builder.

10000 Trees10000 Trees

Features

  • Safe threading support for fast creation.
  • Scriptable Object support for saving Tree Data. (Create > Procedural Generation > Tree Data)

enter image description here

  • Infinite possibilities of trees.

Usage Example

  • Drop "TreeGenerationManager" Prefab into scene.
  • Create a MonoBehaviour script using namespcace "TreeGen".
  public int NumberOfTrees = 100;
  List<GameObject> trees;

  void Start()
  {
      trees = new List<GameObject>();

      for (int i = 0; i < Mathf.RoundToInt(NumberOfTrees / 2); i++)
      {
          for (int y = 0; y < Mathf.RoundToInt(NumberOfTrees / 2); y++)
          {
              TreeData data = ScriptableObject.CreateInstance<TreeData>();
              data.RandomiseParameters();
              TreeGeneratorManager.instance.RequestTree(data, new Vector3(i * 10, 0, y * 10), callback);
          }
      }
  }

  public void callback(GameObject g)
  {
      trees.Add(g);
  }

Todos

  • Add a pooling system.
  • Create vegetation system. (e.g. flowers, plants)

Resources Credits

License

MIT

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published