Class RadioButtonGroup
A control that allows single selection out of a logical group of RadioButton elements. Selecting one will deselect the others.
Inheritance
RadioButtonGroup
Inherited Members
Namespace: UnityEngine.UIElements
Syntax
public class RadioButtonGroup : BaseField<int>, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IBindable, INotifyValueChanged<int>, IMixedValueSupport, IGroupBox
Constructors
RadioButtonGroup()
Initializes and returns an instance of RadioButtonGroup.
Declaration
public RadioButtonGroup()
RadioButtonGroup(String, List<String>)
Initializes and returns an instance of RadioButtonGroup.
Declaration
public RadioButtonGroup(string label, List<string> radioButtonChoices = null)
Parameters
Type | Name | Description |
---|---|---|
String | label | The label for this group |
List<String> | radioButtonChoices | The choices to display in this group |
Fields
ussClassName
USS class name for RadioButtonGroup elements.
Declaration
public static readonly string ussClassName
Field Value
Type | Description |
---|---|
String |
Remarks
Unity adds this USS class to every instance of the RadioButtonGroup element. Any styling applied to this class affects every RadioButtonGroup located beside, or below the stylesheet in the visual tree.
Properties
choices
The list of available choices in the group.
Declaration
public IEnumerable<string> choices { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable<String> |
Remarks
Writing to this property removes existing RadioButton elements and re-creates them to display the new list.
Methods
SetValueWithoutNotify(Int32)
Declaration
public override void SetValueWithoutNotify(int newValue)
Parameters
Type | Name | Description |
---|---|---|
Int32 | newValue |
Overrides
UnityEngine.UIElements.BaseField<System.Int32>.SetValueWithoutNotify(System.Int32)