GetGroup() 공개 정적인 메소드

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).
리턴 RadioBtnGroup,
예제 #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();
     }
 }
예제 #2
0
    /// <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();
        }
    }