Game.Settings.SettingsUIBindingMimicAttribute
Assembly: Assembly-CSharp
Namespace: Game.Settings
Type: class
Base: System.Attribute
Summary:
Attribute that can be applied to a property to indicate that the property should mimic or bind to a named input action within a specified input map. It stores the input map and action identifiers as readonly strings. This attribute is intended for use by the settings UI or binding systems to connect settings properties to in-game input bindings. It can only be applied to properties (AttributeTargets.Property). By default it is not multi-usable (AllowMultiple = false).
Fields
-
public readonly string map
Holds the identifier/name of the input map (e.g., "Keyboard&Mouse", "Gamepad"). Set once via the constructor and intended to be read by UI or binding code. -
public readonly string action
Holds the identifier/name of the input action within the specified map (e.g., "Jump", "MoveForward"). Set via the constructor and used to locate the specific binding to mimic.
Properties
- This attribute declares no properties. It exposes the map and action values as public readonly fields.
Constructors
public SettingsUIBindingMimicAttribute(string map, string action)
Creates a new attribute instance and initializes the readonly fields.- map: The name/identifier of the input map to reference.
- action: The name/identifier of the input action within that map.
Methods
- This attribute defines no methods.
Usage Example
// Example: annotate a settings property so the settings UI can mimic the "Jump" action
// from the "Keyboard&Mouse" input map.
[SettingsUIBindingMimic("Keyboard&Mouse", "Jump")]
public string JumpKeyBinding { get; set; }
// Consumers (e.g., settings UI code) can reflect over properties with this attribute
// to find the map and action and present or sync the corresponding binding in the UI.