Show / Hide Table of Contents

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
System.Object
TriggerVolume
Namespace: GlitchedPolygons.TriggerVolumes
Assembly: UnityScriptsLibrary.dll
Syntax
public class TriggerVolume : MonoBehaviour

Fields

| Improve this Doc View Source

customFilter

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[]
| Improve this Doc View Source

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
| Improve this Doc View Source

firedEvents

The total amount of enter/exit events this TriggerVolume has raised so far.

Declaration
protected int firedEvents
Field Value
Type Description
System.Int32
| Improve this Doc View Source

id

Declaration
protected ID id
Field Value
Type Description
ID
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

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 Source

GetFiredEventsCount()

How many events this TriggerVolume already invoked.

Declaration
public int GetFiredEventsCount()
Returns
Type Description
System.Int32
| Improve this Doc View Source

GetID()

Gets the trigger volume's identifier.

Declaration
public int GetID()
Returns
Type Description
System.Int32

The unique ID (int).

| Improve this Doc View Source

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.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX