Localized spawn volume that lets the system bias spawning when the player is inside the area. This component does not spawn on its own—it's driven by RuntimeSpawner via region-activation signals.
More...
|
| bool | IsActiveSpawner () |
| | Returns whether the player is currently inside this region.
|
| |
| void | ShowHide (bool showHide) |
| | Sets whether to draw the region gizmo in the Scene view.
|
| |
|
| int | min |
| | Optional per-region population override (min,max) applied at runtime. When both values are non-negative, the RegionSpawnLoop uses this range instead of the authored MinObjectCount/MaxObjectCount. Set to (-1, -1) to disable and fall back to authored values.
|
| |
|
| BoxCollider | ThisCollider [get, set] |
| | The collider that defines this region (assigned automatically).
|
| |
| List< string > | RestrictToNavmeshAreas [get, set] |
| | Optional list of NavMesh area names to constrain spawn placement in this region.
|
| |
| List< SpawnEntry > | CustomRegionSpawners [get, set] |
| | Spawner entries that are specific to this region and will be considered when the player is inside.
|
| |
| int | MaxObjectCount [get] |
| | Region-level population cap.
|
| |
| int | MinObjectCount [get] |
| | Region-level minimum population goal.
|
| |
| float | DensityMult = 1f [get, set] |
| | Runtime-only scalar applied by higher-level controllers (e.g., RegionPopulationController) to express relative density for this region. The core spawn loops don’t read this directly; instead, controllers typically bake the effect into DesiredRangeOverride. Exposed primarily for debugging/telemetry or custom UI. Default is 1.
|
| |
| int int max | DesiredRangeOverride = (-1, -1) [get, set] |
| |
|
| static Action< LocalAreaSpawner, bool > | onPlayerIsInRegion |
| | Raised when the player enters or leaves any LocalAreaSpawner. The bool indicates presence: true on enter, false on exit.
|
| |
Localized spawn volume that lets the system bias spawning when the player is inside the area. This component does not spawn on its own—it's driven by RuntimeSpawner via region-activation signals.
Requires a BoxCollider set to Collider.isTrigger.
◆ GetSettings()
Loads or creates the editor settings for gizmo appearance.
◆ IsActiveSpawner()
| bool MegaCrush.Spawner.LocalAreaSpawner.IsActiveSpawner |
( |
| ) |
|
Returns whether the player is currently inside this region.
◆ OnDestroy()
| void MegaCrush.Spawner.LocalAreaSpawner.OnDestroy |
( |
| ) |
|
|
private |
◆ OnDisable()
| void MegaCrush.Spawner.LocalAreaSpawner.OnDisable |
( |
| ) |
|
|
private |
◆ OnDrawGizmos()
| void MegaCrush.Spawner.LocalAreaSpawner.OnDrawGizmos |
( |
| ) |
|
|
private |
Draws the region volume as a gizmo in the Scene view.
◆ OnEnable()
| void MegaCrush.Spawner.LocalAreaSpawner.OnEnable |
( |
| ) |
|
|
private |
◆ OnTriggerExit()
| void MegaCrush.Spawner.LocalAreaSpawner.OnTriggerExit |
( |
Collider | other | ) |
|
|
private |
◆ OnTriggerStay()
| void MegaCrush.Spawner.LocalAreaSpawner.OnTriggerStay |
( |
Collider | other | ) |
|
|
private |
◆ ShowHide()
| void MegaCrush.Spawner.LocalAreaSpawner.ShowHide |
( |
bool | showHide | ) |
|
Sets whether to draw the region gizmo in the Scene view.
- Parameters
-
| showHide | True to show; false to hide. |
◆ Start()
| void MegaCrush.Spawner.LocalAreaSpawner.Start |
( |
| ) |
|
|
private |
◆ customRegionSpawners
| List<SpawnEntry> MegaCrush.Spawner.LocalAreaSpawner.customRegionSpawners = new() |
|
private |
Region-specific spawn entries considered while the player is inside.
◆ isActiveSpawner
| bool MegaCrush.Spawner.LocalAreaSpawner.isActiveSpawner |
|
private |
True if the player is currently within this region.
◆ maxObjectCount
| int MegaCrush.Spawner.LocalAreaSpawner.maxObjectCount = 100 |
|
private |
Maximum number of objects this region should allow when active.
◆ min
| int MegaCrush.Spawner.LocalAreaSpawner.min |
Optional per-region population override (min,max) applied at runtime. When both values are non-negative, the RegionSpawnLoop uses this range instead of the authored MinObjectCount/MaxObjectCount. Set to (-1, -1) to disable and fall back to authored values.
Not serialized. Intended for systems like RegionPopulationController to scale targets dynamically without mutating authoring.
◆ minObjectCount
| int MegaCrush.Spawner.LocalAreaSpawner.minObjectCount = 1 |
|
private |
Minimum number of objects this region should try to maintain when active.
◆ playerTag
| string MegaCrush.Spawner.LocalAreaSpawner.playerTag |
|
private |
Player tag to compare against colliders entering the trigger.
◆ registered
| bool MegaCrush.Spawner.LocalAreaSpawner.registered |
|
private |
Are we registered with the Runtime Spawner?
◆ restrictToNavmeshAreas
| List<string> MegaCrush.Spawner.LocalAreaSpawner.restrictToNavmeshAreas = new() |
|
private |
Optional NavMesh area constraints for this region.
◆ settings
◆ showSpawnVolumes
| bool MegaCrush.Spawner.LocalAreaSpawner.showSpawnVolumes = true |
|
private |
Editor-only toggle to show spawn volume gizmos.
◆ spawner
Owning runtime spawner discovered at startup.
◆ thisCollider
| BoxCollider MegaCrush.Spawner.LocalAreaSpawner.thisCollider |
|
private |
The collider that defines our local region. Set/updated automatically.
◆ CustomRegionSpawners
| List<SpawnEntry> MegaCrush.Spawner.LocalAreaSpawner.CustomRegionSpawners |
|
getset |
Spawner entries that are specific to this region and will be considered when the player is inside.
◆ DensityMult
| float MegaCrush.Spawner.LocalAreaSpawner.DensityMult = 1f |
|
getset |
Runtime-only scalar applied by higher-level controllers (e.g., RegionPopulationController) to express relative density for this region. The core spawn loops don’t read this directly; instead, controllers typically bake the effect into DesiredRangeOverride. Exposed primarily for debugging/telemetry or custom UI. Default is 1.
Not serialized. Changing this value alone does not affect spawning unless your game systems use it.
◆ DesiredRangeOverride
| int int max MegaCrush.Spawner.LocalAreaSpawner.DesiredRangeOverride = (-1, -1) |
|
getset |
◆ MaxObjectCount
| int MegaCrush.Spawner.LocalAreaSpawner.MaxObjectCount |
|
get |
Region-level population cap.
◆ MinObjectCount
| int MegaCrush.Spawner.LocalAreaSpawner.MinObjectCount |
|
get |
Region-level minimum population goal.
◆ RestrictToNavmeshAreas
| List<string> MegaCrush.Spawner.LocalAreaSpawner.RestrictToNavmeshAreas |
|
getset |
Optional list of NavMesh area names to constrain spawn placement in this region.
◆ ThisCollider
| BoxCollider MegaCrush.Spawner.LocalAreaSpawner.ThisCollider |
|
getset |
The collider that defines this region (assigned automatically).
◆ onPlayerIsInRegion
| Action<LocalAreaSpawner, bool> MegaCrush.Spawner.LocalAreaSpawner.onPlayerIsInRegion |
|
static |
Raised when the player enters or leaves any LocalAreaSpawner. The bool indicates presence: true on enter, false on exit.
The documentation for this class was generated from the following file:
- D:/projects/Asset Store Packages/com.megacrush.runtimespawner/Code/Runtime/Components/LocalAreaSpawner.cs