Scylla Framework
  • API Reference
Search Results for

    Show / Hide Table of Contents
    • Scylla.Input
      • AutoResolveChange
      • AutoResolveResult
      • BindingConflict
      • BindingStorageSettings
      • BindingStorageType
      • BridgeSettings
      • BufferedInput
      • ConfigActionEntry
      • ConfigBindingEntry
      • ConfigConflict
      • ConfigSchemeGroup
      • ContextValidationMessage
      • ContextValidationSeverity
      • ControlScheme
      • ControlSchemeChangedEvent
      • ControlSchemeManager
      • ControlSchemeType
      • GamepadButton
      • GamepadType
      • IBindingStorage
      • IControlSchemeManager
      • IInputActionManager
      • IInputBindingManager
      • IInputBridgeManager
      • IInputBufferManager
      • IInputContextManager
      • IInputHintsManager
      • IInputListener
      • IScyllaInputBridge
      • InputActionCanceledEvent
      • InputActionManager
      • InputActionPerformedEvent
      • InputActionStartedEvent
      • InputBindingManager
      • InputBindingsLoadedEvent
      • InputBindingsSavedEvent
      • InputBridgeManager
      • InputBridgeQueryMode
      • InputBufferConsumedEvent
      • InputBufferManager
      • InputBufferedEvent
      • InputConflictResolution
      • InputContext
      • InputContextChangedEvent
      • InputContextDefinition
      • InputContextManager
      • InputContextPoppedEvent
      • InputContextPushedEvent
      • InputDeviceChangedEvent
      • InputDeviceConnectedEvent
      • InputDeviceDisconnectedEvent
      • InputDeviceType
      • InputDeviceUtil
      • InputDisabledEvent
      • InputEnabledEvent
      • InputEventType
      • InputHint
      • InputHintChangedEvent
      • InputHintsManager
      • InputIconSet
      • InputIconSet.IconMapping
      • InputIconSetChangedEvent
      • InputLoggingSettings
      • InputRebindCancelledEvent
      • InputRebindCompletedEvent
      • InputRebindManager
      • InputRebindOperation
      • InputRebindStartedEvent
      • InputRebindUtils
      • JSONFileBindingStorage
      • ManagedRebindCancelledEvent
      • ManagedRebindCompletedEvent
      • ManagedRebindDataRefreshedEvent
      • ManagedRebindStartedEvent
      • PlayerPrefsBindingStorage
      • RebindMode
      • RebindSettings
      • ScyllaInput
      • ScyllaInput.Meta
      • ScyllaInputAction
      • ScyllaInputActionMap
      • ScyllaInputBinding
      • ScyllaInputConfiguration
      • ScyllaInputContextConfiguration
      • ScyllaKey
      • ScyllaKeyConverter
      • ScyllaModifier
      • UnityInputSystemBridge
    • Scylla.Input.Editor
      • ControlSchemeDrawer
      • DeviceStatusWidget
      • IconMappingDrawer
      • InputIconSetEditor
      • ScyllaInputConfigurationEditor
      • ScyllaInputContextConfigurationEditor
      • ScyllaInputDependencyProvider
      • ScyllaInputEditor
      • ScyllaInputMenuItems
      • ScyllaInputWizard

    Class InputHintsManager

    Default implementation of IInputHintsManager. Manages dynamic button prompt icons based on the current input bindings and the active control scheme. Provides UI-ready InputHint data with an internal per-action cache that is automatically invalidated when bindings or control schemes change.

    Inheritance
    object
    InputHintsManager
    Implements
    IInputHintsManager
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Scylla.Input
    Assembly: ScyllaInput.dll
    Syntax
    public class InputHintsManager : IInputHintsManager
    Remarks

    The manager subscribes to InputRebindCompletedEvent and InputBindingsLoadedEvent via the Scylla Event eXchange System to invalidate per-action or full hint caches respectively. It also subscribes directly to OnSchemeChanged for scheme-switch driven cache invalidation.

    Icon set selection follows a four-step fallback chain when resolving a hint for a given scheme type:

    1. The icon set explicitly assigned via SetIconSetForScheme(ControlSchemeType, string).
    2. The global active icon set (ActiveIconSetID).
    3. The first registered icon set whose PrimarySchemeType matches.
    4. The first registered icon set of any type.

    Binding path resolution follows a two-step fallback: first a binding whose device type matches the target scheme's device family; then the first non-composite binding available. Display text falls back from the icon set's DisplayText to Unity's own binding display string when no icon set mapping covers the path.

    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
    public 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
    public bool IsInitialized { get; }
    Property Value
    Type Description
    bool

    Methods

    ~InputHintsManager()

    Finalizer that ensures SEX event subscriptions are disposed even if Shutdown() is never called. This is a defensive measure against leaked subscriptions; callers should always call Shutdown() explicitly as part of clean teardown.

    Declaration
    protected ~InputHintsManager()

    GetActionDisplayText(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
    public string GetActionDisplayText(string actionID)
    Parameters
    Type Name Description
    string actionID

    The string identifier of the action as registered with IInputActionManager. Must not be null or empty.

    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 null if the action does not exist, the manager is not initialized, or no binding could be resolved for the current scheme.

    GetActionIcon(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
    public Sprite GetActionIcon(string actionID)
    Parameters
    Type Name Description
    string actionID

    The string identifier of the action as registered with IInputActionManager. Must not be null or empty.

    Returns
    Type Description
    Sprite

    The icon UnityEngine.Sprite from the active icon set for the action's binding, or null if the action is not found, the manager is not initialized, no icon set is registered for the current scheme, or no mapping exists for the resolved binding path.

    GetActionIcon(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
    public Sprite GetActionIcon(string actionID, ControlSchemeType schemeType)
    Parameters
    Type Name Description
    string actionID

    The string identifier of the action as registered with IInputActionManager. Must not be null or empty.

    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 null if unavailable.

    GetActionIcon(string, string)

    Returns the icon UnityEngine.Sprite for the specified action using a specific named icon set, bypassing the scheme-based selection logic.

    Declaration
    public Sprite GetActionIcon(string actionID, string iconSetID)
    Parameters
    Type Name Description
    string actionID

    The string identifier of the action as registered with IInputActionManager. Must not be null or empty.

    string iconSetID

    The ID of the InputIconSet to query directly. If the icon set is not registered the method returns null. Must not be null or empty.

    Returns
    Type Description
    Sprite

    The icon UnityEngine.Sprite from the specified icon set for the action's binding path, or null if the icon set or binding path is not found.

    GetAllIconSets()

    Returns a read-only snapshot of all currently registered icon sets in registration order.

    Declaration
    public 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)

    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
    public InputHint GetHint(string actionID)
    Parameters
    Type Name Description
    string actionID

    The string identifier of the action as registered with IInputActionManager. Must not be null or empty.

    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, ControlSchemeType)

    Returns the complete InputHint for the specified action under a specific control scheme type. Results are cached per (actionID, schemeType) key.

    Declaration
    public InputHint GetHint(string actionID, ControlSchemeType schemeType)
    Parameters
    Type Name Description
    string actionID

    The string identifier of the action as registered with IInputActionManager. Must not be null or empty.

    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
    public InputIconSet GetIconSet(string iconSetID)
    Parameters
    Type Name Description
    string iconSetID

    The ID of the icon set to retrieve. Must not be null or empty.

    Returns
    Type Description
    InputIconSet

    The InputIconSet instance, or null if no set with the given ID has been registered.

    GetIconSetForScheme(ControlSchemeType)

    Returns the icon set ID that has been explicitly configured for the given control scheme type via SetIconSetForScheme(ControlSchemeType, string).

    Declaration
    public string GetIconSetForScheme(ControlSchemeType schemeType)
    Parameters
    Type Name Description
    ControlSchemeType schemeType

    The ControlSchemeType to query.

    Returns
    Type Description
    string

    The configured icon set ID, or null if no explicit assignment has been made for schemeType. Note that the hints manager may still resolve a usable icon set via the global active set or registered sets even when this returns null.

    HasIconSet(string)

    Checks whether an icon set with the given ID is currently registered.

    Declaration
    public bool HasIconSet(string iconSetID)
    Parameters
    Type Name Description
    string iconSetID

    The ID to check. Must not be null or empty; a null or empty string always returns false.

    Returns
    Type Description
    bool

    true if an icon set with iconSetID is registered; false otherwise.

    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
    public 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 null.

    IControlSchemeManager controlSchemeManager

    The IControlSchemeManager used to determine the active scheme type for default hint queries and to receive scheme-change callbacks. May be null, in which case KeyboardMouse is used as the fallback scheme and no automatic scheme-change invalidation occurs.

    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
    public void InvalidateCache()

    InvalidateCache(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
    public void InvalidateCache(string actionID)
    Parameters
    Type Name Description
    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 null or empty string is a no-op.

    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
    public bool RegisterIconSet(InputIconSet iconSet)
    Parameters
    Type Name Description
    InputIconSet iconSet

    The icon set to register. Must not be null and must have a non-empty IconSetID. Duplicate IDs are rejected.

    Returns
    Type Description
    bool

    true if the icon set was registered successfully; false if iconSet is null, has an empty ID, or an icon set with the same ID is already registered.

    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
    public void SetActiveIconSet(string iconSetID)
    Parameters
    Type Name Description
    string iconSetID

    The ID of the icon set to activate. May be null or empty to clear the global default; scheme-specific assignments configured via SetIconSetForScheme(ControlSchemeType, string) will still be used in that case.

    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
    public 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 null / empty to remove any existing scheme-specific assignment and fall back to the global active set.

    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
    public 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
    public bool UnregisterIconSet(string iconSetID)
    Parameters
    Type Name Description
    string iconSetID

    The ID of the icon set to remove. Must not be null or empty.

    Returns
    Type Description
    bool

    true if an icon set with the given ID was found and removed; false otherwise.

    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
    public 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
    public event Action<string> OnIconSetChanged
    Event Type
    Type Description
    Action<string>

    Implements

    IInputHintsManager

    See Also

    IInputHintsManager
    InputHint
    InputIconSet
    In this article
    Back to top Scylla Framework - Input Module API Documentation