private void ValidateToggleIsInGroup(ExtensionsToggle toggle)
 {
     if (toggle == null || !m_Toggles.Contains(toggle))
     {
         throw new ArgumentException(string.Format("Toggle {0} is not part of ToggleGroup {1}", new object[] { toggle, this }));
     }
 }
 public void RegisterToggle(ExtensionsToggle toggle)
 {
     if (!m_Toggles.Contains(toggle))
     {
         m_Toggles.Add(toggle);
         toggle.onValueChanged.AddListener(NotifyToggleChanged);
     }
 }
 public void UnregisterToggle(ExtensionsToggle toggle)
 {
     if (m_Toggles.Contains(toggle))
     {
         m_Toggles.Remove(toggle);
         toggle.onValueChanged.RemoveListener(NotifyToggleChanged);
     }
 }
 static public int GraphicUpdateComplete(IntPtr l)
 {
     try {
         UnityEngine.UI.ExtensionsToggle self = (UnityEngine.UI.ExtensionsToggle)checkSelf(l);
         self.GraphicUpdateComplete();
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int get_toggleTransition(IntPtr l)
 {
     try {
         UnityEngine.UI.ExtensionsToggle self = (UnityEngine.UI.ExtensionsToggle)checkSelf(l);
         pushEnum(l, (int)self.toggleTransition);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int get_isOn(IntPtr l)
 {
     try {
         UnityEngine.UI.ExtensionsToggle self = (UnityEngine.UI.ExtensionsToggle)checkSelf(l);
         pushValue(l, self.isOn);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int set_toggleTransition(IntPtr l)
 {
     try {
         UnityEngine.UI.ExtensionsToggle self = (UnityEngine.UI.ExtensionsToggle)checkSelf(l);
         UnityEngine.UI.ExtensionsToggle.ToggleTransition v;
         checkEnum(l, 2, out v);
         self.toggleTransition = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int Rebuild(IntPtr l)
 {
     try {
         UnityEngine.UI.ExtensionsToggle self = (UnityEngine.UI.ExtensionsToggle)checkSelf(l);
         UnityEngine.UI.CanvasUpdate     a1;
         checkEnum(l, 2, out a1);
         self.Rebuild(a1);
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int OnSubmit(IntPtr l)
 {
     try {
         UnityEngine.UI.ExtensionsToggle        self = (UnityEngine.UI.ExtensionsToggle)checkSelf(l);
         UnityEngine.EventSystems.BaseEventData a1;
         checkType(l, 2, out a1);
         self.OnSubmit(a1);
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int set_isOn(IntPtr l)
 {
     try {
         UnityEngine.UI.ExtensionsToggle self = (UnityEngine.UI.ExtensionsToggle)checkSelf(l);
         bool v;
         checkType(l, 2, out v);
         self.isOn = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int set_onValueChanged(IntPtr l)
 {
     try {
         UnityEngine.UI.ExtensionsToggle             self = (UnityEngine.UI.ExtensionsToggle)checkSelf(l);
         UnityEngine.UI.ExtensionsToggle.ToggleEvent v;
         checkType(l, 2, out v);
         self.onValueChanged = v;
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 public void NotifyToggleOn(ExtensionsToggle toggle)
 {
     ValidateToggleIsInGroup(toggle);
     for (int i = 0; i < m_Toggles.Count; i++)
     {
         if (m_Toggles[i] == toggle)
         {
             SelectedToggle = toggle;
         }
         else
         {
             m_Toggles[i].IsOn = false;
         }
     }
     onToggleGroupChanged.Invoke(AnyTogglesOn());
 }
        public void NotifyToggleOn(ExtensionsToggle toggle)
        {
            ValidateToggleIsInGroup(toggle);

            // disable all toggles in the group
            for (var i = 0; i < m_Toggles.Count; i++)
            {
                if (m_Toggles[i] == toggle)
                {
                    SelectedToggle = toggle;
                    continue;
                }

                m_Toggles[i].isOn = false;
            }
            onToggleGroupChanged.Invoke(AnyTogglesOn());
        }