Requires Unity 2022.3 LTS or later. Tested on Windows, WebGL, Android and iOS.
There are several ways to install Procedural Toolkit:
Package Manager
The best way is to install this library as a Git package using the Package Manager.
First, make sure that you to have Git installed and available in your system's PATH.
Then you can add the package using the link below, notice the upm branch at the end of the line:
If you don't want to use Git, you can download this library as an archive and install it as a local package.
Asset Store or .unitypackage
The other way is to import a package from the Asset Store
or the Releases page.
If you have any previous versions of the toolkit installed, it is highly recommended to delete them before importing a newer version.
Getting started
After installation you can import ProceduralToolkit namespace and start building your own PCG systems:
csharp
using UnityEngine;
using ProceduralToolkit;
publicclassReadmeExample : MonoBehaviour
{
privatevoidUpdate()
{
Debug.Log(string.Format("<color=#{0}>{0}</color>", RandomE.colorHSV.ToHtmlStringRGB()));
}
}
If you are using Assembly Definitions,
you will also need to add ProceduralToolkit as a reference.
I have a problem with Procedural Toolkit
First, please search the open issues
and closed issues
to see if your issue hasn't already been reported. If it does exist, add a
:thumbsup: to the issue to indicate this is also an issue for you, and add a
comment if there is extra information you can contribute.
If you can't find a matching issue, open a new issue,
choose the right template and provide us with enough information to investigate further.
Alternatively, you can send a message to the support email.
Contributing
See CONTRIBUTING for a full guide on how you can help.
If you're looking for something to work on, check out the help wanted label.
If you just want to show your appreciation, you can send a donation through PayPal or Ko-fi.
Toolkit structure
Runtime/
ArrayE: Various Array and List extensions, such as looped getters/setters and flood fills.
CellularAutomaton: Generic cellular automaton for two-state rulesets.
Common rulesets can be found in CellularAutomaton.Ruleset.
ClipperUtility: Utility class for conversion of Clipper data from and to Unity format.
ColorE: Color extensions, HTML colors, Gradient constructors.
ColorHSV: Serializable representation of color in HSV model.
CompoundMeshDraft: Helper class for mesh generation supporting large meshes and submeshes.
DebugE: Collection of drawing methods similar to Debug.DrawLine.
Directions: Enum with direction flags along three axes.
Draw: Collection of generic vector drawing algorithms.
DrawRaster: Collection of generic raster drawing algorithms.
GizmosE: Collection of drawing methods similar to Gizmos.
GLE: Collection of GL drawing methods similar to Gizmos.
A fully procedural building generator, creates an entire mesh from scratch and paints it's vertices.
Keep in mind that the generated mesh has no uv map so using it with Standard shader is pointless.
BuildingGeneratorComponent: A simple minimal example on how you can use BuildingGenerator
BuildingGeneratorConfigurator: A configurator for BuildingGenerator with UI and editor controls.
BuildingGeneratorReuse: An example on how you can reuse the same generator to generate multiple buildings.
ProceduralFacadePlanner: A facade planning strategy, controls the layouts of the facades.
ProceduralFacadeConstructor: A facade construction strategy, used in conjunction with ProceduralFacadePlanner.
ProceduralRoofPlanner: A roof planning strategy, generates a roof description based on the input config.
ProceduralRoofConstructor: A roof construction strategy, used in conjunction with ProceduralRoofPlanner.
ProceduralFacadeElements: A collection of fully procedural facade panels for the building generator.
PolygonAsset: A ScriptableObject container for vertices.