A class in Root.Township, Alta.PAGaC.
A PAGaC rule asset that, where its pattern matches, edits the tag grid with a list of steps (set, remove or clear tags per cell). Used by the generation Constructor.
Constructors
| Member | What it is |
|---|
GenerationRule() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
4 private and internal fields
| Member | What it is |
|---|
private int[] serializedStepTagCounts | Flattened tag count per step cell, used for Unity serialization. |
private Tag[] serializedStepTags | Flattened step tags, used for Unity serialization. |
private List<GenerationRule.Step> steps | Backing field for Steps. |
private List<Tag>[,,,] stepTags | Backing field for StepTags. |
Properties
| Member | What it is |
|---|
List<GenerationRule.Step> Steps { get; } | The steps run in order on a match. Set puts the first tag in the cell, Remove clears the cell if its tag is listed, Clear empties it. |
List<Tag>[,,,] StepTags { get; } | Tag lists indexed by step, x, y and z. |
Methods
| Member | What it is |
|---|
void ForceBeforeSerialize() | Runs the serialize callback by hand to flatten the tag grids into the serialized arrays. |
List<Tag> GetStepTags(int step, int x, int y, int z) | The tags a given step uses at one cell of the rule. |
void OnValidate() | Resizes the tag grids to the current size, configuration and step counts. |
3 private and internal methods
| Member | What it is |
|---|
private void UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize() | Rebuilds the match and step tag grids from the flattened serialized arrays. |
private void UnityEngine.ISerializationCallbackReceiver.OnBeforeSerialize() | Resizes and flattens the match and step tag grids into the serialized arrays. |
private void Resize(bool isClearing, ref List<Tag>[,,,] tags, int configurations, int sizeX, int sizeY, int sizeZ) | Resizes a four dimensional tag grid, optionally clearing it. |
Used in
Members of other types that take, return or hold a GenerationRule: