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). |
Результат | RadioBtnGroup, |
public static RadioBtnGroup GetGroup(int id)
{
RadioBtnGroup group= null;
for (int i = 0; i < groups.Count; ++i)
{
if(groups[i].groupID == id)
{
group = groups[i];
break;
}
}
if (group == null)
group = new RadioBtnGroup(id);
return group;
}
}
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(); } }