public static GetGroup ( int id ) : RadioBtnGroup, | ||
id | int | The ID of the group (either an arbitrary integer ID, or the hashcode of a radio button's parent transform, depending on the settings). |
return | RadioBtnGroup, |
public void SetGroup(int groupID) { if (this.group != null) { this.group.buttons.Remove(this); this.group = null; } this.radioGroup = groupID; this.group = RadioBtnGroup.GetGroup(groupID); this.group.buttons.Add(this); if (this.btnValue) { this.PopOtherButtonsInGroup(); } }
/// <summary> /// Makes the radio button a part of the specified group /// and it will thenceforth be mutually exclusive to all /// other radio buttons in the same group. /// </summary> /// <param name="groupID">The ID of the group to which this radio will be assigned. Can be an arbitrary integer, or if useParentForGrouping is true, the hashcode of the parent transform.</param> public void SetGroup(int groupID) { // Remove from any existing group first: if (group != null) { group.buttons.Remove(this); group = null; } radioGroup = groupID; group = RadioBtnGroup.GetGroup(groupID); // Add self to the button group: group.buttons.Add(this); if (btnValue) { PopOtherButtonsInGroup(); } }