示例#1
0
 public void Toggle()
 {
     if (isInGroup)
     {
         if (parent == null)
         {
             parent = transform.parent.GetComponent <CUIToggleGroup>();
         }
         if (parent == null)
         {
             parent = transform.parent.parent.GetComponent <CUIToggleGroup>();
         }
         parent.OnChildToggled(this, true, false, true);
     }
     else
     {
         if (isSelected)
         {
             Deselect();
         }
         else
         {
             Select();
         }
     }
 }
示例#2
0
        private void Awake()
        {
            button = GetComponent <Button>();

            if (isInGroup)
            {
                parent = transform.GetComponentInParent <CUIToggleGroup>();
            }
        }
示例#3
0
        private void Reset()
        {
            CUIToggleGroup group = transform.parent.GetComponent <CUIToggleGroup>();

            if (group != null)
            {
                group.FindChildrenToggles();
            }
        }
示例#4
0
 public void SetParentToggleGroup(CUIToggleGroup group)
 {
     parent = group;
 }