Class InputIconSet
A ScriptableObject asset that maps Unity Input System binding paths to icon sprites and human-readable display strings for a specific platform or device family. Used by InputHintsManager to provide UI-ready button prompt visuals.
Inherited Members
Namespace: Scylla.Input
Assembly: ScyllaInput.dll
Syntax
[CreateAssetMenu(fileName = "InputIconSet", menuName = "Scylla/Input/Icon Set")]
public class InputIconSet : ScriptableObject
Remarks
Create an asset via the Unity asset menu at Scylla / Input / Icon Set.
Each icon set is associated with a primary ControlSchemeType
(e.g., Gamepad or KeyboardMouse) and an optional GamepadType
for platform-specific button artwork (e.g., Xbox vs. PlayStation glyphs).
At runtime the list of InputIconSet.IconMapping entries is compiled into an internal dictionary keyed on normalized (lowercase, trimmed) binding paths for efficient O(1) lookups. The cache is built lazily on first use and is invalidated automatically when the asset is modified in the Inspector or when InvalidateCache() is called explicitly after runtime modifications to Mappings.
Register icon set assets with RegisterIconSet(InputIconSet) after the input module has initialized. Multiple icon sets can be registered simultaneously and selected per-scheme via SetIconSetForScheme(ControlSchemeType, string).
Fields
DisplayName
A human-readable name for this icon set, shown in editor tools and debug output
(e.g., "Xbox Controller", "Keyboard").
Declaration
[Tooltip("Human-readable display name for this icon set")]
public string DisplayName
Field Value
| Type | Description |
|---|---|
| string |
GamepadType
The specific gamepad platform this icon set targets, enabling the hint system to select platform-appropriate artwork (e.g., circle/cross vs. A/B button labels). Only meaningful when PrimarySchemeType is Gamepad; ignored for keyboard/mouse and touch sets.
Declaration
[Tooltip("The gamepad platform this icon set is designed for")]
public GamepadType GamepadType
Field Value
| Type | Description |
|---|---|
| GamepadType |
IconSetID
The unique string identifier used to register and look up this icon set with IInputHintsManager. Must be non-empty and unique among all registered icon sets.
Declaration
[Header("Identification")]
[Tooltip("Unique identifier for this icon set")]
public string IconSetID
Field Value
| Type | Description |
|---|---|
| string |
Mappings
The list of binding-path-to-icon/text mappings that make up this icon set. Each entry maps a Unity Input System binding path to an optional sprite and an optional display string. Duplicate binding paths are silently ignored - only the first occurrence is used when the runtime cache is built.
Declaration
[Header("Mappings")]
[Tooltip("The binding path to icon/text mappings")]
public List<InputIconSet.IconMapping> Mappings
Field Value
| Type | Description |
|---|---|
| List<InputIconSet.IconMapping> |
PrimarySchemeType
The control scheme type that this icon set primarily serves. When a new icon set is registered and no icon set is yet assigned for this scheme type, the icon set is automatically set as the default for the scheme. This also controls the device family used when resolving binding paths via GetActionIcon(string, string).
Declaration
[Tooltip("The primary control scheme type this icon set is designed for")]
public ControlSchemeType PrimarySchemeType
Field Value
| Type | Description |
|---|---|
| ControlSchemeType |
Methods
GetDisplayText(string)
Returns the human-readable display string for the specified binding path as
configured in the DisplayText field, or null
if no mapping exists or the display text is empty.
Declaration
public string GetDisplayText(string bindingPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | bindingPath | The binding path to look up. A |
Returns
| Type | Description |
|---|---|
| string | The display string (e.g., |
GetIcon(string)
Returns the icon UnityEngine.Sprite associated with the specified binding path,
or null if no mapping exists for the path or the mapping's
Icon is unassigned.
Declaration
public Sprite GetIcon(string bindingPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | bindingPath | The binding path to look up. A |
Returns
| Type | Description |
|---|---|
| Sprite | The icon UnityEngine.Sprite for the binding, or |
GetMapping(string)
Returns the InputIconSet.IconMapping for the specified Unity Input System binding path, building the internal lookup cache on first call. The lookup is case-insensitive and whitespace-tolerant.
Declaration
public InputIconSet.IconMapping GetMapping(string bindingPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | bindingPath | The binding path to look up, for example |
Returns
| Type | Description |
|---|---|
| InputIconSet.IconMapping | The matching InputIconSet.IconMapping, or |
HasMapping(string)
Returns a value indicating whether this icon set contains a mapping entry for the specified binding path. The check is case-insensitive and whitespace-tolerant.
Declaration
public bool HasMapping(string bindingPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | bindingPath | The binding path to check. A |
Returns
| Type | Description |
|---|---|
| bool |
|
InvalidateCache()
Clears the internal runtime lookup cache, forcing it to be rebuilt from Mappings on the next call to GetMapping(string), GetIcon(string), GetDisplayText(string), or HasMapping(string). Call this after modifying Mappings at runtime outside of the Inspector.
Declaration
public void InvalidateCache()