Global, designer-authored library that defines rule-based spawn entries for LocalAreaSpawner regions. The RegionPopulationController queries this asset at runtime to resolve each region's LocalAreaSpawner.CustomRegionSpawners based on:
-
Region tags (semantic string labels supplied by the game).
-
Current SpawnDirector step (0-based).
-
Optional weights by normalized step (0..1).
More...
|
| struct | Rule |
| | A single library rule that can contribute a SpawnEntry to a region when its filters match the region's tags and the current director step is within range. More...
|
| |
|
| float | EvaluateWeight (in Rule rule, int currentStep, int stepsCount) |
| | Computes this rule's selection weight for sorting purposes given the current step.
|
| |
|
| static float | NormalizeStep (int currentStep, int stepsCount) |
| | Normalizes a step index to the range 0..1 using stepsCount .
|
| |
|
| List< Rule > | rules = new() |
| | All authored rules. The RegionPopulationController scans this list to build region spawn sets each time the director step changes.
|
| |
| List< SpawnEntry > | fallbackEntries = new() |
| | Fallback entries used when no rules match a region. Leave empty to produce no entries.
|
| |
Global, designer-authored library that defines rule-based spawn entries for LocalAreaSpawner regions. The RegionPopulationController queries this asset at runtime to resolve each region's LocalAreaSpawner.CustomRegionSpawners based on:
-
Region tags (semantic string labels supplied by the game).
-
Current SpawnDirector step (0-based).
-
Optional weights by normalized step (0..1).
This lets you add a new enemy once (as a rule) and have it flow to all matching tiles, instead of editing dozens of regions by hand. Rules can either append to a tile's authored list or replace it when matched.
◆ EvaluateWeight()
| float MegaCrush.Spawner.RegionSpawnLibrary.EvaluateWeight |
( |
in Rule | rule, |
|
|
int | currentStep, |
|
|
int | stepsCount ) |
Computes this rule's selection weight for sorting purposes given the current step.
- Parameters
-
| rule | The rule to evaluate. |
| currentStep | The current 0-based SpawnDirector step. |
| stepsCount | The total number of steps defined by the director's profile (≥ 1). Used to normalize the X axis of rule .Rule.weightByStep. |
- Returns
- A non-negative weight value (0 disables the rule, 1 is neutral). If the curve is unset or empty, returns 1.
◆ NormalizeStep()
| static float MegaCrush.Spawner.RegionSpawnLibrary.NormalizeStep |
( |
int | currentStep, |
|
|
int | stepsCount ) |
|
static |
Normalizes a step index to the range 0..1 using stepsCount .
- Parameters
-
| currentStep | Current 0-based step. |
| stepsCount | Total steps (≥ 1). |
- Returns
- Normalized step in 0..1. If stepsCount ≤ 1, returns 1.
◆ fallbackEntries
| List<SpawnEntry> MegaCrush.Spawner.RegionSpawnLibrary.fallbackEntries = new() |
Fallback entries used when no rules match a region. Leave empty to produce no entries.
◆ rules
| List<Rule> MegaCrush.Spawner.RegionSpawnLibrary.rules = new() |
All authored rules. The RegionPopulationController scans this list to build region spawn sets each time the director step changes.
The documentation for this class was generated from the following file:
- D:/projects/Asset Store Packages/com.pixelwizards.runtimespawner/Code/Runtime/ScriptableObjects/RegionSpawnLibrary.cs