ButtonManager.cs
This script allows the user to bind events to the capacitive hardware buttons below the Looking Glass device.
If ButtonManager.cs is not attached to a Game Object, it will self-instantiate with default settings. To override, attach ButtonManager.cs to a Game Object and modify settings there.
For an example of how to use the Hardware Buttons, consult the "7 - Hardware Buttons" scene located in "Holoplay/Examples".

Fields

emulateWithKeyboard

Type: bool
If true (default), buttons can be emulated using 1/2/3/4 on alphanumeric keyboard.

Functions

GetButton(ButtonType button)

Returns: bool
Returns true while the button identified is held down.
1
if (ButtonManager.GetButton(ButtonType.SQUARE)) print("square is held");
Copied!

GetButtonDown(ButtonType button)

Returns: bool
Returns true during the frame the user pressed down the button.
1
if (ButtonManager.GetButtonDown(ButtonType.SQUARE)) print("square was pressed");
Copied!

GetButtonUp(ButtonType button)

Returns: bool
Returns true the first frame the user releases the button
1
if (ButtonManager.GetButtonDown(ButtonType.SQUARE)) print("square was released");
Copied!

GetAnyButtonDown()

Returns: bool
Returns true the first frame the user presses any button
1
if (ButtonManager.GetAnyButtonDown()) print("a button was pressed");
Copied!
Last modified 6mo ago