Skip to content

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

enum Manus::Interaction::PushButton::ButtonType {
    PushAndHold,
    PushToToggle
};

Public Attributes Documentation

variable associatedPosition

Transform Manus.Interaction.PushButton.associatedPosition;

variable emptyAreasForRelease

CollisionArea [] Manus.Interaction.PushButton.emptyAreasForRelease;

variable filledAreasForPress

CollisionArea [] Manus.Interaction.PushButton.filledAreasForPress;

variable localPositionPressed

Vector3 Manus.Interaction.PushButton.localPositionPressed;

variable localPositionStateOff

Vector3 Manus.Interaction.PushButton.localPositionStateOff;

variable localPositionStateOn

Vector3 Manus.Interaction.PushButton.localPositionStateOn;

variable movingPart

Transform Manus.Interaction.PushButton.movingPart;

variable onPressed

Action<PushButton> Manus.Interaction.PushButton.onPressed;

variable onReleased

Action<PushButton> Manus.Interaction.PushButton.onReleased;

variable onStateOff

Action<PushButton> Manus.Interaction.PushButton.onStateOff;

variable onStateOn

Action<PushButton> Manus.Interaction.PushButton.onStateOn;

variable type

ButtonType Manus.Interaction.PushButton.type;

Public Properties Documentation

property normalizedValue

float Manus.Interaction.PushButton.normalizedValue;

Implements Manus::Interaction::IValue::normalizedValue

property pressed

bool Manus.Interaction.PushButton.pressed;

property state

bool Manus.Interaction.PushButton.state;

property value

float Manus.Interaction.PushButton.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.

inline void Manus::Interaction::PushButton::OnCollisionAreasChanged (
    CollisionArea p_Area
) 

Parameters:

  • p_Area The area that changed

Protected Attributes Documentation

variable m_Pressed

bool Manus.Interaction.PushButton.m_Pressed;

variable m_Reevaluate

Coroutine Manus.Interaction.PushButton.m_Reevaluate;

variable m_State

bool Manus.Interaction.PushButton.m_State;

Protected Functions Documentation

function UpdateMovingPart

inline void Manus::Interaction::PushButton::UpdateMovingPart () 

The documentation for this class was generated from the following file api/unity-plugin/Scripts/Interaction/PushButton.cs