![]() |
FCV Engine 0.1
A tool and framework for tutorials in game development
|
Represents a pressure-sensitive button that activates when an object stands on it for a specified duration. Supports optional bounce-back functionality when the object leaves before full activation. Fires events when fully activated and during intermediate states for animations. More...
Private Member Functions | |
void | Update () |
Handles bounce-back behavior, gradually resetting the button's state when not fully activated and no object is standing on it. Only applicable if bounceBack is enabled. | |
void | OnTriggerExit2D (Collider2D other) |
Detects when an object leaves the button's trigger area. Updates the standing state and stops activation if conditions are met. | |
void | OnTriggerEnter2D (Collider2D other) |
Detects when an object enters the button's trigger area. Sets the standing state and prepares for activation. | |
void | OnTriggerStay2D (Collider2D other) |
Handles the activation process while an object stays on the button. Gradually increases the activation state and fires the buttonFired event when fully activated. | |
void | AnimateOffset (float percentile) |
Handles bounce-back behavior, gradually resetting the button's state when not fully activated and no object is standing on it. Only applicable if bounceBack is enabled. | |
Represents a pressure-sensitive button that activates when an object stands on it for a specified duration. Supports optional bounce-back functionality when the object leaves before full activation. Fires events when fully activated and during intermediate states for animations.
Definition at line 11 of file PressureButton.cs.
|
private |
Detects when an object enters the button's trigger area. Sets the standing state and prepares for activation.
other | The collider that entered the trigger. |
Definition at line 65 of file PressureButton.cs.
|
private |
Detects when an object leaves the button's trigger area. Updates the standing state and stops activation if conditions are met.
other | The collider that exited the trigger. |
Definition at line 54 of file PressureButton.cs.
|
private |
Handles the activation process while an object stays on the button. Gradually increases the activation state and fires the buttonFired event when fully activated.
other | The collider that stays within the trigger. |
Definition at line 76 of file PressureButton.cs.