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 = = null The 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.PushToToggle 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
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
Public Attributes Documentation
variable associatedPosition
variable emptyAreasForRelease
variable filledAreasForPress
variable localPositionPressed
variable localPositionStateOff
variable localPositionStateOn
variable movingPart
variable onPressed
variable onReleased
variable onStateOff
variable onStateOn
variable type
Public Properties Documentation
property normalizedValue
Implements Manus::Interaction::IValue::normalizedValue
property pressed
property state
property value
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_Area
The area that changed
Protected Attributes Documentation
variable m_Pressed
variable m_Reevaluate
variable m_State
Protected Functions Documentation
function UpdateMovingPart
The documentation for this class was generated from the following file api/unity-plugin/Scripts/Interaction/PushButton.cs