Skip to main content

Class HoldablePhysicalButton

Controls a 3D button that visually responds to interaction by nudging its scale, and provides a hold-to-activate mechanic with a progress indicator.

public class HoldablePhysicalButton : MonoBehaviour

Inheritance​

Methods​

OnButtonPressInput(CallbackContext)​

Handles input actions related to pressing the button. Updates hold timer multiplier and pressed state based on input context.

public void OnButtonPressInput(InputAction.CallbackContext context)

Parameters​

NameTypeDescription
contextInputAction.CallbackContextInput action callback context.

SetPressed(bool)​

Sets the pressed state of the button.

public void SetPressed(bool pressed)

Parameters​

NameTypeDescription
pressedboolTrue if the button is pressed; false otherwise.
  • Methods
    • OnButtonPressInput(CallbackContext)
    • SetPressed(bool)