Class TriggerVolume
Represents a trigger volume that fires various events when something has entered/escaped its UnityEngine.BoxCollider volume.
You can decide what happens when specific objects enter this trigger volume by hooking up the events inside the TriggerVolume's inspector.
Inheritance
Namespace: GlitchedPolygons.TriggerVolumes
Assembly: UnityScriptsLibrary.dll
Syntax
public class TriggerVolume : MonoBehaviour
Fields
| Improve this Doc View SourcecustomFilter
You can filter specific Colliders to be the only ones feasible of raising the OnTriggerEnter/Exit events (after filtering by layer and tag).
Declaration
protected Collider[] customFilter
Field Value
| Type | Description |
|---|---|
| Collider[] |
delaySeconds
Delay in seconds (e.g. the player enters the trigger volume and the OnTriggerEnter event is fired in [delay] seconds).
Declaration
protected float delaySeconds
Field Value
| Type | Description |
|---|---|
| System.Single |
firedEvents
The total amount of enter/exit events this TriggerVolume has raised so far.
Declaration
protected int firedEvents
Field Value
| Type | Description |
|---|---|
| System.Int32 |
id
Declaration
protected ID id
Field Value
| Type | Description |
|---|---|
| ID |
layerMask
Only intruders that pass this LayerMask filter will be able to fire the OnTriggerEnter/Exit events.
Declaration
protected LayerMask layerMask
Field Value
| Type | Description |
|---|---|
| LayerMask |
maxEvents
Limits how many times this trigger is allowed to fire its events. A value of one would allow this trigger to be fired only once in its lifetime; zero means no limits at all (infinite trigger firing).
Declaration
protected int maxEvents
Field Value
| Type | Description |
|---|---|
| System.Int32 |
tags
You can specify a list of tags of which each intruder has to have at least one in order to pass the filter.
An empty array disables the tag filter (meaning that any tag is ok).
Declaration
protected string[] tags
Field Value
| Type | Description |
|---|---|
| System.String[] |
Methods
| Improve this Doc View SourceGetFiredEventsCount()
How many events this TriggerVolume already invoked.
Declaration
public int GetFiredEventsCount()
Returns
| Type | Description |
|---|---|
| System.Int32 |
GetID()
Gets the trigger volume's identifier.
Declaration
public int GetID()
Returns
| Type | Description |
|---|---|
| System.Int32 | The unique ID (int). |
SetFiredEventsCount(Int32)
Sets firedEvents. Useful when loading from a savegame.
Declaration
public void SetFiredEventsCount(int firedEvents)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | firedEvents | The new amount of times the trigger has fired. |