Tracks the current and historical population of spawned objects, including metadata and source breakdowns.
More...
|
| int | GetCount (SpawnSource s) |
| | Gets the count for a specific SpawnSource.
|
| |
| void | Add (GameObject go) |
| | Adds a new object with unknown source.
|
| |
| void | Add (GameObject go, in SpawnMeta meta) |
| | Adds a new object with associated metadata.
|
| |
| void | Remove (GameObject go) |
| | Removes an object from tracking (not necessarily culled).
|
| |
| void | Remove (GameObject go, bool cull) |
| | Removes an object from tracking.
|
| |
| int | CountBySourceName (SpawnSource source, string name) |
| |
| int | CountByRegion (LocalAreaSpawner region) |
| |
| bool | Contains (GameObject go) |
| | Checks whether the tracker contains this object.
|
| |
| bool | TryGetMeta (GameObject go, out SpawnMeta meta) |
| | Tries to retrieve the metadata for a tracked object.
|
| |
|
| IReadOnlyList< GameObject > | Spawned [get] |
| | All currently spawned objects.
|
| |
| int | Current [get] |
| | Current active population count.
|
| |
| int | Total [get] |
| | Total spawned ever (monotonic).
|
| |
| IReadOnlyDictionary< SpawnSource, int > | BySource [get] |
| | Breakdown of population count per SpawnSource.
|
| |
| IReadOnlyDictionary< string, int > | SpecialsByTag [get] |
| | Breakdown of special spawns by tag.
|
| |
|
| Action< GameObject > | OnSpawned |
| | Raised when an object is spawned (legacy simple event).
|
| |
| Action< GameObject > | OnCulled |
| | Raised when an object is culled (only fired when cull==true).
|
| |
| Action< int > | OnPopulationChanged |
| | Raised whenever the active population count changes.
|
| |
| Action< GameObject, SpawnMeta > | OnSpawnedWithMeta |
| | Raised when an object is spawned with its metadata.
|
| |
| Action< GameObject, SpawnMeta > | OnDespawned |
| | Raised when an object is despawned (removed from tracking).
|
| |
Tracks the current and historical population of spawned objects, including metadata and source breakdowns.
◆ Add() [1/2]
| void MegaCrush.Spawner.PopulationTracker.Add |
( |
GameObject | go | ) |
|
Adds a new object with unknown source.
◆ Add() [2/2]
| void MegaCrush.Spawner.PopulationTracker.Add |
( |
GameObject | go, |
|
|
in SpawnMeta | meta ) |
Adds a new object with associated metadata.
◆ Contains()
| bool MegaCrush.Spawner.PopulationTracker.Contains |
( |
GameObject | go | ) |
|
Checks whether the tracker contains this object.
◆ CountByRegion()
| int MegaCrush.Spawner.PopulationTracker.CountByRegion |
( |
LocalAreaSpawner | region | ) |
|
◆ CountBySourceName()
| int MegaCrush.Spawner.PopulationTracker.CountBySourceName |
( |
SpawnSource | source, |
|
|
string | name ) |
◆ GetCount()
| int MegaCrush.Spawner.PopulationTracker.GetCount |
( |
SpawnSource | s | ) |
|
Gets the count for a specific SpawnSource.
◆ Remove() [1/2]
| void MegaCrush.Spawner.PopulationTracker.Remove |
( |
GameObject | go | ) |
|
Removes an object from tracking (not necessarily culled).
◆ Remove() [2/2]
| void MegaCrush.Spawner.PopulationTracker.Remove |
( |
GameObject | go, |
|
|
bool | cull ) |
Removes an object from tracking.
- Parameters
-
| go | The object to remove. |
| cull | If true, also fires the legacy OnCulled event. |
◆ TryGetMeta()
| bool MegaCrush.Spawner.PopulationTracker.TryGetMeta |
( |
GameObject | go, |
|
|
out SpawnMeta | meta ) |
Tries to retrieve the metadata for a tracked object.
◆ _bySource
| readonly Dictionary<SpawnSource, int> MegaCrush.Spawner.PopulationTracker._bySource = new() |
|
private |
◆ _bySourceAndName
| readonly Dictionary<(SpawnSource src, string name), int> MegaCrush.Spawner.PopulationTracker._bySourceAndName = new() |
|
private |
◆ _current
| int MegaCrush.Spawner.PopulationTracker._current |
|
private |
◆ _meta
| readonly Dictionary<GameObject, SpawnMeta> MegaCrush.Spawner.PopulationTracker._meta = new() |
|
private |
◆ _spawned
| readonly List<GameObject> MegaCrush.Spawner.PopulationTracker._spawned = new() |
|
private |
◆ _specialsByTag
| readonly Dictionary<string, int> MegaCrush.Spawner.PopulationTracker._specialsByTag = new() |
|
private |
◆ _total
| int MegaCrush.Spawner.PopulationTracker._total |
|
private |
◆ BySource
| IReadOnlyDictionary<SpawnSource, int> MegaCrush.Spawner.PopulationTracker.BySource |
|
get |
Breakdown of population count per SpawnSource.
◆ Current
| int MegaCrush.Spawner.PopulationTracker.Current |
|
get |
Current active population count.
◆ Spawned
| IReadOnlyList<GameObject> MegaCrush.Spawner.PopulationTracker.Spawned |
|
get |
All currently spawned objects.
◆ SpecialsByTag
| IReadOnlyDictionary<string, int> MegaCrush.Spawner.PopulationTracker.SpecialsByTag |
|
get |
Breakdown of special spawns by tag.
◆ Total
| int MegaCrush.Spawner.PopulationTracker.Total |
|
get |
Total spawned ever (monotonic).
◆ OnCulled
| Action<GameObject> MegaCrush.Spawner.PopulationTracker.OnCulled |
Raised when an object is culled (only fired when cull==true).
◆ OnDespawned
| Action<GameObject, SpawnMeta> MegaCrush.Spawner.PopulationTracker.OnDespawned |
Raised when an object is despawned (removed from tracking).
◆ OnPopulationChanged
| Action<int> MegaCrush.Spawner.PopulationTracker.OnPopulationChanged |
Raised whenever the active population count changes.
◆ OnSpawned
| Action<GameObject> MegaCrush.Spawner.PopulationTracker.OnSpawned |
Raised when an object is spawned (legacy simple event).
◆ OnSpawnedWithMeta
| Action<GameObject, SpawnMeta> MegaCrush.Spawner.PopulationTracker.OnSpawnedWithMeta |
Raised when an object is spawned with its metadata.
The documentation for this class was generated from the following file:
- D:/projects/Asset Store Packages/com.megacrush.runtimespawner/Code/Runtime/Internals/PopulationTracker.cs