标题: 随机树干生成插件Procedural Tree [打印本页] 作者: 710960383 时间: 2017-5-5 14:34 标题: 随机树干生成插件Procedural Tree Requires Unity 4.3.0 or higher.
Works on all Unity versions from 4.3 and 5.0.
Procedural Tree Generation Example Script. This asset package contains a simple, yet powerful, C# script that can generate countless different procedural trees.
The C# script is fully commented, and very easy to understand or modify. It’s a single MonoBehaviour class component that you can apply to any object to get a tree in your game. A single main Branch(…) recursive function generates all the mesh vertices.
The trees can be modified in the editor or in the game in real-time (growing, twisting … or dancing!). There’s a bunch of parameters you can modify to control the generation algorithm. Like the number of vertices, number of sides, radius properties, roundness, twisting, branching probability, etc. It’s also very easy to apply any Unity material to the trees.
The generated tree mesh will remain in your scene, and only ever be computed again if/when you change any generation parameters.
You can modify the source to add your own unique tree features. If you do, please share! ;-)