Interface IInputHintsManager
Defines the contract for a service that provides UI-ready button prompt data based on the current input bindings and the active control scheme.
Namespace: Scylla.Input
Assembly: ScyllaInput.dll
Syntax
public interface IInputHintsManager
Remarks
The hints manager maps action IDs to InputHint values, each of
which bundles a display string (e.g., "Space", "A"), an optional
icon UnityEngine.Sprite, the raw binding path, and the applicable scheme type.
Results are cached internally and regenerated automatically when bindings change
(via InputRebindCompletedEvent or InputBindingsLoadedEvent)
or when the active control scheme changes.
The concrete implementation InputHintsManager supports multiple registered InputIconSet assets that supply sprite mappings for different device families. A per-scheme icon set assignment controls which set is used when querying hints for KeyboardMouse, Gamepad, or Touch.
Obtain an instance through ScyllaInput after the module has initialized. Do not call Initialize(IInputActionManager, IControlSchemeManager) or Shutdown() directly - those are managed by the module lifecycle.
Properties
ActiveIconSetID
Gets the ID of the icon set that is currently designated as the global default.
Individual schemes may override this via SetIconSetForScheme(ControlSchemeType, string).
Returns null if no icon set has been explicitly activated.
Declaration
string ActiveIconSetID { get; }
Property Value
| Type | Description |
|---|---|
| string |
IsInitialized
Gets a value indicating whether this hints manager has been successfully
initialized via Initialize(IInputActionManager, IControlSchemeManager). Hint retrieval methods return
Invalid and icon lookups return null when
this is false.
Declaration
bool IsInitialized { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
GetActionDisplayText(string, string)
Returns the human-readable display string for the specified action's binding
under the currently active control scheme (e.g., "Space", "A",
"Left Click").
Declaration
string GetActionDisplayText(string mapID, string actionID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mapID | |
| string | actionID | The string identifier of the action as registered with
IInputActionManager. Must not be |
Returns
| Type | Description |
|---|---|
| string | The display string from the matched icon set mapping, or the Unity Input System's
own binding display string if no icon set mapping is found. Returns |
GetActionIcon(string, string)
Returns the icon UnityEngine.Sprite for the specified action using the currently active control scheme to select the appropriate binding and icon set.
Declaration
Sprite GetActionIcon(string mapID, string actionID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mapID | |
| string | actionID | The string identifier of the action as registered with
IInputActionManager. Must not be |
Returns
| Type | Description |
|---|---|
| Sprite | The icon UnityEngine.Sprite from the active icon set for the action's binding,
or |
GetActionIcon(string, string, ControlSchemeType)
Returns the icon UnityEngine.Sprite for the specified action using a particular control scheme type to select the binding path and icon set.
Declaration
Sprite GetActionIcon(string mapID, string actionID, ControlSchemeType schemeType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mapID | |
| string | actionID | The string identifier of the action as registered with
IInputActionManager. Must not be |
| ControlSchemeType | schemeType | The ControlSchemeType whose icon set and device bindings should be used for the lookup. Pass Unknown to fall back to the general active icon set. |
Returns
| Type | Description |
|---|---|
| Sprite | The icon UnityEngine.Sprite for the binding that matches the given scheme type,
or |
GetActionIcon(string, string, string)
Returns the icon UnityEngine.Sprite for the specified action using a specific named icon set, bypassing the scheme-based selection logic.
Declaration
Sprite GetActionIcon(string mapID, string actionID, string iconSetID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mapID | |
| string | actionID | The string identifier of the action as registered with
IInputActionManager. Must not be |
| string | iconSetID | The ID of the InputIconSet to query directly. If the icon set is
not registered the method returns |
Returns
| Type | Description |
|---|---|
| Sprite | The icon UnityEngine.Sprite from the specified icon set for the action's binding
path, or |
GetAllIconSets()
Returns a read-only snapshot of all currently registered icon sets in registration order.
Declaration
IReadOnlyList<InputIconSet> GetAllIconSets()
Returns
| Type | Description |
|---|---|
| IReadOnlyList<InputIconSet> | A read-only list of InputIconSet instances. The list is empty when no icon sets have been registered. The returned reference is stable until the next call to RegisterIconSet(InputIconSet) or UnregisterIconSet(string). |
GetHint(string, string)
Returns the complete InputHint for the specified action under the currently active control scheme. Results are cached; the cache is invalidated automatically when bindings or the active scheme change.
Declaration
InputHint GetHint(string mapID, string actionID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mapID | |
| string | actionID | The string identifier of the action as registered with
IInputActionManager. Must not be |
Returns
| Type | Description |
|---|---|
| InputHint | An InputHint containing the display text, icon sprite, binding path, and scheme type, or Invalid if the action is not found, the manager is not initialized, or no binding can be resolved. |
GetHint(string, string, ControlSchemeType)
Returns the complete InputHint for the specified action under a
specific control scheme type. Results are cached per
(actionID, schemeType) key.
Declaration
InputHint GetHint(string mapID, string actionID, ControlSchemeType schemeType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mapID | |
| string | actionID | The string identifier of the action as registered with
IInputActionManager. Must not be |
| ControlSchemeType | schemeType | The ControlSchemeType for which to retrieve the hint. The method selects the icon set configured for this scheme via SetIconSetForScheme(ControlSchemeType, string) (falling back to the active icon set, then the first icon set registered for the scheme, then any available icon set). |
Returns
| Type | Description |
|---|---|
| InputHint | An InputHint for the given action and scheme, or Invalid if no binding or icon set data could be resolved. |
GetIconSet(string)
Returns the registered InputIconSet with the specified ID.
Declaration
InputIconSet GetIconSet(string iconSetID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | iconSetID | The ID of the icon set to retrieve. Must not be |
Returns
| Type | Description |
|---|---|
| InputIconSet | The InputIconSet instance, or |
GetIconSetForScheme(ControlSchemeType)
Returns the icon set ID that has been explicitly configured for the given control scheme type via SetIconSetForScheme(ControlSchemeType, string).
Declaration
string GetIconSetForScheme(ControlSchemeType schemeType)
Parameters
| Type | Name | Description |
|---|---|---|
| ControlSchemeType | schemeType | The ControlSchemeType to query. |
Returns
| Type | Description |
|---|---|
| string | The configured icon set ID, or |
HasIconSet(string)
Checks whether an icon set with the given ID is currently registered.
Declaration
bool HasIconSet(string iconSetID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | iconSetID | The ID to check. Must not be |
Returns
| Type | Description |
|---|---|
| bool |
|
Initialize(IInputActionManager, IControlSchemeManager)
Initializes the hints manager and subscribes to binding change and control scheme change events for automatic cache invalidation. Must be called once before any hint retrieval methods are used. Subsequent calls while already initialized are logged as warnings and are otherwise ignored.
Declaration
void Initialize(IInputActionManager actionManager, IControlSchemeManager controlSchemeManager)
Parameters
| Type | Name | Description |
|---|---|---|
| IInputActionManager | actionManager | The IInputActionManager used to look up registered actions and
their current binding paths. Must not be |
| IControlSchemeManager | controlSchemeManager | The IControlSchemeManager used to determine the active scheme type
for default hint queries and to receive scheme-change callbacks. May be
|
InvalidateCache()
Clears all cached InputHint entries, forcing every subsequent hint query to rebuild its result from the current binding and icon set data. This is called automatically by the hints manager when bindings or the active scheme change; calling it manually is only necessary when icon set mappings are modified at runtime outside of the standard registration API.
Declaration
void InvalidateCache()
InvalidateCache(string, string)
Clears all cached InputHint entries for the given action ID across all scheme types, and raises OnHintChanged to notify subscribers. This is called automatically after a successful rebind for the affected action; calling it manually is only necessary when binding data is modified externally.
Declaration
void InvalidateCache(string mapID, string actionID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mapID | |
| string | actionID | The ID of the action whose cached hints should be invalidated. Cache entries for
all ControlSchemeType variants of this action are removed.
A |
RegisterIconSet(InputIconSet)
Registers an InputIconSet asset with the hints manager, making its binding-to-sprite mappings available for hint lookups. If the icon set's PrimarySchemeType is not yet mapped to any icon set, this set is automatically assigned as the default for that scheme. Registering an icon set invalidates the hint cache.
Declaration
bool RegisterIconSet(InputIconSet iconSet)
Parameters
| Type | Name | Description |
|---|---|---|
| InputIconSet | iconSet | The icon set to register. Must not be |
Returns
| Type | Description |
|---|---|
| bool |
|
ResolveIconSetForScheme(ControlSchemeType)
Returns the icon set ID that hint lookups will actually use for the given control scheme type, after the full fallback chain has been applied.
Declaration
string ResolveIconSetForScheme(ControlSchemeType schemeType)
Parameters
| Type | Name | Description |
|---|---|---|
| ControlSchemeType | schemeType | The ControlSchemeType to resolve an icon set for. |
Returns
| Type | Description |
|---|---|
| string | The resolved icon set ID, or |
Remarks
This is the question a status readout or a debug overlay wants answered. GetIconSetForScheme(ControlSchemeType) reports the configured mapping, which for a gamepad is usually the registration default rather than what the prompts are actually resolving against, because a detected controller brand supersedes that default without rewriting it.
The chain is, in order: the deliberate assignment from SetIconSetForScheme(ControlSchemeType, string); for Gamepad, the registered set whose GamepadType matches DetectedGamepadType; the scheme's registration default; the global ActiveIconSetID; the first registered set whose PrimarySchemeType matches; and finally any registered set at all.
SetActiveIconSet(string)
Sets the globally active icon set by ID, used as the default fallback when no scheme-specific set is configured. Setting the active icon set invalidates the hint cache and raises OnIconSetChanged.
Declaration
void SetActiveIconSet(string iconSetID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | iconSetID | The ID of the icon set to activate. May be |
SetIconSetForScheme(ControlSchemeType, string)
Associates a specific icon set with a control scheme type so that all hint lookups for that scheme retrieve icons from the given set. This takes precedence over the globally active icon set. Changes invalidate the hint cache.
Declaration
void SetIconSetForScheme(ControlSchemeType schemeType, string iconSetID)
Parameters
| Type | Name | Description |
|---|---|---|
| ControlSchemeType | schemeType | The ControlSchemeType to configure. |
| string | iconSetID | The ID of the icon set to use for the scheme, or |
Shutdown()
Shuts down the hints manager, unsubscribes all internal event listeners, clears
all registered icon sets and cached hints, and releases references to the action
and control scheme managers. After this call IsInitialized is
false and all hint retrieval methods return empty or invalid results.
Declaration
void Shutdown()
UnregisterIconSet(string)
Unregisters the InputIconSet with the given ID, removing its mappings from the hints manager. If the removed set was the configured set for its PrimarySchemeType, that scheme's mapping is cleared. If the removed set was the active icon set, the active set is reassigned to the first remaining icon set, or cleared if none remain. Unregistering invalidates the hint cache.
Declaration
bool UnregisterIconSet(string iconSetID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | iconSetID | The ID of the icon set to remove. Must not be |
Returns
| Type | Description |
|---|---|
| bool |
|
Events
OnHintChanged
Raised when the cached hint for a specific action is invalidated and the hint data should be considered stale. The string argument is the action ID whose hint changed. UI components displaying a prompt for a single action can subscribe to this event instead of listening to the broader OnIconSetChanged.
Declaration
event Action<string> OnHintChanged
Event Type
| Type | Description |
|---|---|
| Action<string> |
OnIconSetChanged
Raised when the active icon set changes globally or per-scheme, indicating that
all displayed button prompts may need to be refreshed. The string argument is the
ID of the newly active icon set (may be null if the active set was
cleared). This event is also raised in response to control scheme switches.
Declaration
event Action<string> OnIconSetChanged
Event Type
| Type | Description |
|---|---|
| Action<string> |