A class in Root.Township, Alta.PAGaC.
Editor test component for the PAGaC grid generator: runs the generation steps on its children and builds the result from an option set.
Constructors
| Member | What it is |
|---|
GenerationBase() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
9 private and internal fields
| Member | What it is |
|---|
private Tag air | Backing field for Air. |
private GameObject generated | The object built from the last generation. |
private bool isRegenerating | Inspector button that regenerates with the same seed. |
private bool isRegeneratingWithNewSeed | Inspector button that regenerates with a random seed. |
private OptionSet optionSet | Options used to build the generated grid into objects. |
private int seed | Backing field for Seed. |
private int sizeX | Backing field for SizeX. |
private int sizeY | Backing field for SizeY. |
private int sizeZ | Backing field for SizeZ. |
Properties
| Member | What it is |
|---|
Tag Air { get; } | The tag for empty cells. |
Generator Generator { get; private set; } | The grid from the last generation. |
int Seed { get; } | Random seed for generation. |
int SizeX { get; } | Grid width in cells. |
int SizeY { get; } | Grid height in cells. |
int SizeZ { get; } | Grid depth in cells. |
Methods
3 private and internal methods
| Member | What it is |
|---|
private void Generate() | Seeds the random state, runs each active child GenerationStep, then builds the object from optionSet as a child. |
private void OnDrawGizmos() | Draws a small cube in each tagged cell, coloured by its tag. |
private void OnValidate() | Runs Generate when one of the regenerate buttons is pressed in the inspector, picking a new seed if asked. |
Used in
Members of other types that take, return or hold a GenerationBase: