Skip to content

BooltonAttribute

Namespace: SideXP.Core | Inherits from: PropertyAttribute

public class BooltonAttribute : PropertyAttribute

Displays a button to enable/disable a boolean value instead of the regular

Constructors

BooltonAttribute()

public BooltonAttribute()

Displays a button to enable/disable a boolean value instead of the regular

BooltonAttribute(string)

public BooltonAttribute(string callbackName)

Displays a button to enable/disable a boolean value instead of the regular

Parameters

  • callbackName

Properties

CallbackName

public string CallbackName

The name of the function to call (from this script) when the button is clicked.

Remarks

The callback can be a function (no return type and a single boolean parameter), or a boolean setter.

Toggle

public bool Toggle

By default, a button with a label "Enable/Disable" will be displayed for this property. If this option is enabled, a regular toggle field will be used, so the named callback can still be invoked without changing the common usage of this property.