RadioBtnGroup.GetGroup C# (CSharp) Méthode

GetGroup() public static méthode

Returns a reference to the radio button group specified by "id".
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).
Résultat 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;
	}
}

Usage Example

Exemple #1
0
 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();
     }
 }
All Usage Examples Of RadioBtnGroup::GetGroup