Eye of the Nile Docs
Everything you need to know to get started!
Loading...
Searching...
No Matches
PressurePlate Class Reference

Detailed Description

Used by pressure plates to detect entities standing on it and to activate/deactivate a connected object.

Documentation updated 12/22/2024

Author
Alexander Art
Todo
Make this script part of a pressure plate prefab that is more functional and versatile.

Public Attributes

GameObject affectedObject
 The object that deactivates when touched by the pressure plate.
 
List< GameObject > entitiesOnPlate
 List of entities standing on the pressure plate.
 

Private Member Functions

void Update ()
 
void OnTriggerEnter2D (Collider2D collision)
 Runs when a collider touches the pressure plate. If it is a valid entity, add it to the list.

Parameters
collision

 
void OnTriggerExit2D (Collider2D collision)
 Runs when a collider steps off of the pressure plate. Removes objects that are no longer on the pressure plate from the list.

Parameters
collision

 

Member Function Documentation

◆ OnTriggerEnter2D()

void PressurePlate.OnTriggerEnter2D ( Collider2D collision)
private

Runs when a collider touches the pressure plate. If it is a valid entity, add it to the list.

Parameters
collision

◆ OnTriggerExit2D()

void PressurePlate.OnTriggerExit2D ( Collider2D collision)
private

Runs when a collider steps off of the pressure plate. Removes objects that are no longer on the pressure plate from the list.

Parameters
collision

◆ Update()

void PressurePlate.Update ( )
private

Member Data Documentation

◆ affectedObject

GameObject PressurePlate.affectedObject

The object that deactivates when touched by the pressure plate.

◆ entitiesOnPlate

List<GameObject> PressurePlate.entitiesOnPlate

List of entities standing on the pressure plate.


The documentation for this class was generated from the following file: