Components/ Input Prompt

samples

Attributes

samples
Attribute Description
InputActionName Name of input action to pick from input actions.
OverrideIconSprite InputPrompt displays icon according to InputActionName. You can override it with this.
OverrideIconText InputPrompt displays text according to InputActionName. You can override it with this.
MinSize Min width and height of the icon.
ButtonIf List of InputIconControlScheme. If the list contains KeyboardMouse, the InputPrompt will automatically switch to being interactable so it can be clicked with mouse. However, when switching to a gamepad, it will no longer be interactable, ensuring that auto-navigation ignores it. This prevents navigation with d-pad from selecting the InputPrompt, which is typically not desirable.
HideIf List of InputIconControlScheme. Hide the InputPrompt automatically on desired input control schemes.
PlayerIndex Index of the player this InputPrompt should display input for. Used in multiplayer scenarios to show different player inputs.
HideIfPlayerIndexMissing If true, hides the InputPrompt when the specified PlayerIndex doesn't have an active PlayerInput. Useful for dynamic multiplayer UI.

InputIconControlScheme

enum

  • KeyboardMouse
  • Xbox
  • PlayStation4
  • PlayStation5

Integration with InputDeviceManager

InputPrompt works closely with InputDeviceManager which has 2 responsibilities:

  • Detecting input scheme changes to automatically update InputPrompt icons and texts.
  • Connection between InputPrompt and InputIconDatabase.
  • Managing player input registration and control scheme tracking for multiplayer scenarios.

The InputPrompt automatically subscribes to InputDeviceManager events to update its display when players join/leave or when control schemes change.

inputdevicemanager

Integration with LunaUIManager

InputPrompt integrates with LunaUIManager to access the InputIconDatabase. The LunaUIManager provides the IconDatabase property which contains the input icons for different control schemes.

When InputPrompt needs to display an icon, it queries the LunaUIManager's IconDatabase to get the appropriate sprite and text for the current control scheme.

InputIconDatabase

Dictionaries of sprites for each control scheme.

Icons used: https://www.kenney.nl/assets/input-prompts

inputicondatabase