Gears
API ReferenceAttributes

SettingPlayerActionAttribute

Assigns the PlayerAction held by a static field or property to the Binding setting its path names. Pass the declaring type to BindSettingsClass and Gears reads the member and sets IControlBindingSetting.PlayerAction from it.

Sealed classNamespace GearsAPI.AttributesAssembly GearsAPI.dllSource
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public sealed class SettingPlayerActionAttribute : SettingPathAttribute

Works the other way round from SettingAttribute: Gears reads the member rather than writing to it. The member must be static and declared as InControl.PlayerAction or a class derived from it. A field may be readonly; a property needs a getter, which may be private. The path must name a Binding setting, so it is always a global path, "tabName.CategoryName.SettingName". Gears reads the member once, while BindSettingsClass runs, and never again. SyncSettingsToClass does not read it. Create your PlayerActionSet before you bind: a member that is null at that point is logged and skipped, and the row reads "- Missing PlayerAction -". Every other problem is also logged and skips that member only. See the Bind Settings with Attributes guide.

Inheritance: Object → Attribute → SettingPathAttribute → SettingPlayerActionAttribute
Attributes: AttributeUsageAttribute

Constructors

SettingPlayerActionAttribute(String)

public SettingPlayerActionAttribute(string settingPath)

Initializes the attribute with the path of the Binding setting.

On this page