Skip to content
eisclimber edited this page Apr 4, 2026 · 1 revision

Button

Class in ExPresSXR.Interaction.ValueRangeInteractable

Inherits from ValueRangeInteractable\<T, U, V\>

Summary

Defines a button interactable.

public class Button : ValueRangeInteractable<ButtonDescriptor, ButtonVisualizer, float>

Fields

Name Description
OnButtonPressReset Emitted when the toggle mode of the button has changed.
OnPressed Emitted when the button is pressed not in toggle mode.
OnReleased Emitted when the button is released not in toggle mode.
OnToggleModeChanged Emitted when the toggle mode of the button has changed.
OnTogglePressed Emitted when the button is pressed and toggled to the down position.
OnToggleReleased Emitted when the button is released and toggled to the up position.

Methods

Name Description
InternalEmitPressedSignal() Used in the editor. Emits the pressed event.
InternalEmitReleasedSignal() Used in the editor. Emits the release event.
InternalEmitTogglePressedSignal() Used in the editor. Emits the toggle pressed event.
InternalEmitToggleReleasedSignal() Used in the editor. Emits the toggle released event.
InternalForceNextPressState() Used in the editor. Allows changing the repress timeout of the value descriptor.
IsHoverableBy(IXRHoverInteractor) Determines if the interactable can be hovered by an IXRHoverInteractor.
IsSelectableBy(IXRSelectInteractor) Determines if the interactable can be selected by an IXRSelectInteractor.
ResetButtonPress() Resets the button pressed state.
Use it instead of the "ResetValue()" with toggle mode to ensure the correct toggle state.
ResetValue() Resets to the default (raw) value of the range.
SetValueToMaxValue() Sets the value to the maximum value of the range.
SetValueToMinValue() Sets the value to the minimum value of the range.
UpdateValueVisualization() Function wrapper that wraps the function calls for the different toggle modes.

Properties

Name Description
MaxInteractionDistance Max distance to to an interactor to be able to interact with the button.
This is a hack for being able to determine if the button is hovered near or far.
Pressed Current pressed state.
ToggleMode If the button press is pressed normally or should toggle.
Value Accessor for the current value of the ValueDescriptor.
Overwritten whether

ExPresS XR Wiki

Tutorial Pages

Code Documentation

Clone this wiki locally