Game.Settings.SettingsUIGamepadActionAttribute
Assembly: Assembly-CSharp (game assembly)
Namespace: Game.Settings
Type: class
Base: SettingsUIInputActionAttribute
Summary:
Attribute used to declare a settings UI input action that targets the gamepad device. This attribute is a convenience wrapper around SettingsUIInputActionAttribute that automatically supplies InputManager.DeviceType.Gamepad to the base attribute. Apply it to a settings-related class (or other supported targets) to describe a gamepad input action (name, action type, analog/digital mode, custom usages, interactions and processors, and developer-only/allow-modifier flags). It has several constructor overloads to support common declaration patterns.
Fields
None
This type introduces no private or public fields of its own; it only forwards arguments to its base class.
Properties
None
This type does not declare additional properties; any behavior or data is provided by the base SettingsUIInputActionAttribute.
Constructors
-
public SettingsUIGamepadActionAttribute(string name, ActionType type = ActionType.Button, bool allowModifiers = true, bool developerOnly = false, Mode mode = Mode.Analog, string[] usages = null, string[] interactions = null, string[] processors = null)
Creates a gamepad input action attribute with full control over action type, modifier allowance, developer-only flag, analog/digital mode, and optional usage/interactions/processors lists. Defaults: type = Button, allowModifiers = true, developerOnly = false, mode = Analog. -
public SettingsUIGamepadActionAttribute(string name, ActionType type, Mode mode, params string[] customUsages)
Convenience overload that specifies action type, analog/digital mode, and a params array of custom usages. -
public SettingsUIGamepadActionAttribute(string name, ActionType type, params string[] customUsages)
Convenience overload that specifies action type and custom usages; mode defaults to Mode.Analog. -
public SettingsUIGamepadActionAttribute(string name, Mode mode, params string[] customUsages)
Convenience overload that specifies analog/digital mode and custom usages; action type defaults to Button. -
public SettingsUIGamepadActionAttribute(string name, params string[] customUsages)
Simplest overload: just the action name and optional custom usages; defaults to ActionType.Button and Mode.Analog.
Methods
None
This attribute class defines no additional methods; it relies on the behavior implemented by its base class.
Usage Example
// Basic usage with just a name:
[SettingsUIGamepadAction("OpenMenu")]
public class MySettingsClass { }
// Specify action type and custom usages:
[SettingsUIGamepadAction("Accept", ActionType.Button, "ButtonSouth")]
public class AcceptSettings { }
// Full control over parameters:
[SettingsUIGamepadAction(
"MoveAxis",
ActionType.Value,
allowModifiers: false,
developerOnly: false,
mode: Mode.Analog,
usages: new[] { "LeftStick" },
interactions: new[] { "Hold" },
processors: new[] { "Normalize" })]
public class MoveSettings { }
Notes: - name: logical name of the input action as used by the settings UI/system. - ActionType: typically Button or Value (depending on whether the action is digital or continuous). - Mode: Analog vs. Digital interpretation for the input. - customUsages/usages: device-specific usage strings (e.g., "ButtonSouth", "LeftStick") to help identify the control. - interactions/processors: input system interaction and processor strings that may be applied to the binding. - allowModifiers / developerOnly: flags controlling modifier-key allowance and whether the binding is shown only to developers.