Class RadioButton
A control that allows users to select a single option inside a RadioButtonGroup
Inheritance
Inherited Members
Namespace: UnityEngine.UIElements
Syntax
public class RadioButton : BaseBoolField, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IBindable, INotifyValueChanged<bool>, IMixedValueSupport, IGroupBoxOption
Constructors
RadioButton()
Creates a RadioButton with no label.
Declaration
public RadioButton()
RadioButton(String)
Creates a RadioButton with a Label and a default manipulator.
Declaration
public RadioButton(string label)
Parameters
Type | Name | Description |
---|---|---|
String | label | The Label text. |
Remarks
The default manipulator makes it possible to activate the RadioButton with a left mouse click.
Fields
checkmarkBackgroundUssClassName
USS class name of checkmark background in RadioButton elements.
Declaration
public static readonly string checkmarkBackgroundUssClassName
Field Value
Type | Description |
---|---|
String |
Remarks
Unity adds this USS class to the checkmark background sub-element of the RadioButton.
checkmarkUssClassName
USS class name of checkmark in RadioButton elements.
Declaration
public static readonly string checkmarkUssClassName
Field Value
Type | Description |
---|---|
String |
Remarks
Unity adds this USS class to the checkmark sub-element of the RadioButton.
inputUssClassName
USS class name of input elements in RadioButton elements.
Declaration
public static readonly string inputUssClassName
Field Value
Type | Description |
---|---|
String |
Remarks
Unity adds this USS class to the input sub-element of the RadioButton. The input sub-element provides responses to the manipulator.
labelUssClassName
USS class name for Labels in RadioButton elements.
Declaration
public static readonly string labelUssClassName
Field Value
Type | Description |
---|---|
String |
Remarks
Unity adds this USS class to the Label sub-element of the RadioButton if the RadioButton has a Label.
textUssClassName
USS class name of Text elements in RadioButton elements.
Declaration
public static readonly string textUssClassName
Field Value
Type | Description |
---|---|
String |
Remarks
Unity adds this USS class to Text sub-elements of the RadioButton.
ussClassName
USS class name for RadioButton elements.
Declaration
public static readonly string ussClassName
Field Value
Type | Description |
---|---|
String |
Remarks
Unity adds this USS class to every instance of the RadioButton element. Any styling applied to this class affects every RadioButton located beside, or below the stylesheet in the visual tree.
Properties
value
Declaration
public override bool value { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Overrides
Methods
InitLabel()
Declaration
protected override void InitLabel()
Overrides
SetSelected(Boolean)
Declaration
public void SetSelected(bool selected)
Parameters
Type | Name | Description |
---|---|---|
Boolean | selected |
SetValueWithoutNotify(Boolean)
Declaration
public override void SetValueWithoutNotify(bool newValue)
Parameters
Type | Name | Description |
---|---|---|
Boolean | newValue |
Overrides
ToggleValue()
Declaration
protected override void ToggleValue()
Overrides
UpdateMixedValueContent()
Declaration
protected override void UpdateMixedValueContent()