Skip to content

Class Manus::Interaction::RockerSwitch

ClassList > Manus > Interaction > RockerSwitch

A rocker switch implementation, has an On and Off state.

Inherits the following classes: MonoBehaviour, Manus::Interaction::IValue

Public Attributes

Type Name
CollisionArea[] collisionAreasOff
Collision areas that are used to trigger the Off state.
CollisionArea[] collisionAreasOn
Collision areas that are used to trigger the On state.
bool initialState = = false
This is the initial state of the object when it is enabled, true for On and false for Off.
Action< RockerSwitch > onStateOff
The action called when the state changes to Off.
Action< RockerSwitch > onStateOn
The action called when the state changes to On.
Transform pivot = = null
The pivot used to rotate around when changing states.
Vector3 pivotExtentlocalRotation = = new Vector3(10.0f, 0.0f, 0.0f)
The rotational extents used to rotate when changing states.

Public Properties

Type Name
property float normalizedValue
The normalized value.
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_State = = false

Protected Functions

Type Name
void SetState (bool p_State)
Sets the switch's state and invokes the desired actions.

Public Attributes Documentation

variable collisionAreasOff

CollisionArea [] Manus.Interaction.RockerSwitch.collisionAreasOff;

variable collisionAreasOn

CollisionArea [] Manus.Interaction.RockerSwitch.collisionAreasOn;

variable initialState

bool Manus.Interaction.RockerSwitch.initialState;

variable onStateOff

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

variable onStateOn

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

variable pivot

Transform Manus.Interaction.RockerSwitch.pivot;

variable pivotExtentlocalRotation

Vector3 Manus.Interaction.RockerSwitch.pivotExtentlocalRotation;

Public Properties Documentation

property normalizedValue

float Manus.Interaction.RockerSwitch.normalizedValue;

Implements Manus::Interaction::IValue::normalizedValue

property value

float Manus.Interaction.RockerSwitch.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::RockerSwitch::OnCollisionAreasChanged (
    CollisionArea p_Area
) 

Parameters:

  • p_Area The area that changed

Protected Attributes Documentation

variable m_State

bool Manus.Interaction.RockerSwitch.m_State;

Protected Functions Documentation

function SetState

Sets the switch's state and invokes the desired actions.

inline void Manus::Interaction::RockerSwitch::SetState (
    bool p_State
) 

Parameters:

  • p_State True for On and False for Off

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