Skip to content
This repository was archived by the owner on Aug 14, 2019. It is now read-only.

Trigger.cs

Erik edited this page Apr 26, 2019 · 5 revisions

Script: Trigger.cs


Dependencies (What do I need to include to use this script in another project?):
  • None
Public Methods:
  • None
Public Events:
  • OnTriggered(GameObject go) - When triggered is tripped, passes the triggering object to subscribers as a parameter.
Configurable Fields:
  • None
General Overview:

Trigger.cs is slightly different than a Collider trigger. This trigger acts as a remote initiator for other scripts and methods. On its own, this does not perform any game logic. However, another script can reference a trigger via the inspector and subscribe to its OnTriggered method. This allows multiple different scripts, gameObjects, etc to listen to the same trigger and respond to the same event.

Clone this wiki locally