A class in Root.Township, the global namespace.
A trigger that tracks which pickups with any of the allowed tags are inside it and raises events as they come and go.
Constructors
| Member | What it is |
|---|
PickupArea() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|
private PickupEvent added | Backing field for Added. |
private List<PickupTag> allowedTags | Pickup tags that count. A pickup needs at least one. |
private HashSet<Pickup> contained | Backing field for Contained. |
private bool isAllowingCrafted | Whether crafted pickups count. |
private PickupEvent removed | Backing field for Removed. |
Properties
| Member | What it is |
|---|
PickupEvent Added { get; } | Event raised when an allowed pickup enters. |
HashSet<Pickup> Contained { get; } | The allowed pickups inside right now. |
PickupEvent Removed { get; } | Event raised when a pickup leaves, is destroyed, or the area is disabled. |
Methods
4 private and internal methods
| Member | What it is |
|---|
private void Destroyed(NetworkEntity entity, bool isUnload) | Private: removes a contained pickup when it is destroyed and raises Removed. |
private void OnDisable() | Private: raises Removed for every contained pickup and clears the set. |
private void OnTriggerEnter(Collider other) | Private: adds a pickup that has an allowed tag and is not being destroyed. Crafted ones only if isAllowingCrafted. |
private void OnTriggerExit(Collider other) | Private: removes a pickup that leaves and raises Removed. |
Used in
Members of other types that take, return or hold a PickupArea: