Class Manus::Interaction::PushButton
ClassList > Manus > Interaction > PushButton
A simple button implementation, has two ways of being turned on or off.
Inherits the following classes: MonoBehaviour, Manus::Interaction::IValue
Public Types
| Type | Name |
|---|---|
| enum | ButtonType PushToToggle simulates a button that remains 'pressed' after being pressed and can be released by pressing it again. PushAndHold simulates a simple button which sends an On signal when pressed and Off when released. |
Public Attributes
| Type | Name |
|---|---|
| Transform | associatedPosition |
| CollisionArea[] | emptyAreasForRelease All of the collision areas need to be empty in order for the button to stop being pressed. |
| CollisionArea[] | filledAreasForPress At least one collision area in this list needs to be filled in order to start being pressed. |
| Vector3 | localPositionPressed The position of the button when it is in the pressed state. |
| Vector3 | localPositionStateOff The position of the button when it is in the Off state. |
| Vector3 | localPositionStateOn The position of the button when it is in the On state. |
| Transform | movingPart = nullThe button which is moved. |
| Action< PushButton > | onPressed The event triggered when the button starts being pressed. |
| Action< PushButton > | onReleased The event triggered when the button is no longer being pressed. |
| Action< PushButton > | onStateOff The event triggered when the button state turns to Off. |
| Action< PushButton > | onStateOn The event triggered when the button state turns to On. |
| ButtonType | type = ButtonType.PushToToggleThe button type determines what happens when the button gets pressed. PushToToggle simulates a button that remains 'pressed' after being pressed and can be released by pressing it again. PushAndHold simulates a simple button which sends an On signal when pressed and Off when released. |
Public Properties
| Type | Name |
|---|---|
| property float | normalizedValue The normalized value, if there is no limit then 1.0f is a full 360 degree rotation. |
| property bool | pressed Is the button pressed? |
| property bool | state The current state of the button, True for On and False for off. |
| property float | value The value, this value is either 1 or 0. |
Public Properties inherited from Manus::Interaction::IValue
See Manus::Interaction::IValue
| Type | Name |
|---|---|
| property float | normalizedValue |
| property float | value |
Public Functions
| Type | Name |
|---|---|
| void | OnCollisionAreasChanged (CollisionArea p_Area) This function is called when a collision area changes. This could mean an object either started or stopped touching the collision area. |
Protected Attributes
| Type | Name |
|---|---|
| bool | m_Pressed = false |
| Coroutine | m_Reevaluate = null |
| bool | m_State = false |
Protected Functions
| Type | Name |
|---|---|
| void | UpdateMovingPart () Updates the location of the moving part. |
Public Types Documentation
enum ButtonType
PushToToggle simulates a button that remains 'pressed' after being pressed and can be released by pressing it again. PushAndHold simulates a simple button which sends an On signal when pressed and Off when released.
Public Attributes Documentation
variable associatedPosition
variable emptyAreasForRelease
All of the collision areas need to be empty in order for the button to stop being pressed.
variable filledAreasForPress
At least one collision area in this list needs to be filled in order to start being pressed.
variable localPositionPressed
The position of the button when it is in the pressed state.
variable localPositionStateOff
The position of the button when it is in the Off state.
variable localPositionStateOn
The position of the button when it is in the On state.
variable movingPart
The button which is moved.
variable onPressed
The event triggered when the button starts being pressed.
variable onReleased
The event triggered when the button is no longer being pressed.
variable onStateOff
The event triggered when the button state turns to Off.
variable onStateOn
The event triggered when the button state turns to On.
variable type
The button type determines what happens when the button gets pressed. PushToToggle simulates a button that remains 'pressed' after being pressed and can be released by pressing it again. PushAndHold simulates a simple button which sends an On signal when pressed and Off when released.
Public Properties Documentation
property normalizedValue
The normalized value, if there is no limit then 1.0f is a full 360 degree rotation.
Implements Manus::Interaction::IValue::normalizedValue
property pressed
Is the button pressed?
property state
The current state of the button, True for On and False for off.
property value
The value, this value is either 1 or 0.
Implements Manus::Interaction::IValue::value
Public Functions Documentation
function OnCollisionAreasChanged
This function is called when a collision area changes. This could mean an object either started or stopped touching the collision area.
Parameters:
p_AreaThe area that changed
Protected Attributes Documentation
variable m_Pressed
variable m_Reevaluate
variable m_State
Protected Functions Documentation
function UpdateMovingPart
Updates the location of the moving part.
The documentation for this class was generated from the following file api/unity-plugin/Scripts/Interaction/PushButton.cs