public void RegisterToggle(ColoredToggle toggle)
 {
     if (!m_Toggles.Contains(toggle))
     {
         m_Toggles.Add(toggle);
     }
 }
 public void UnregisterToggle(ColoredToggle toggle)
 {
     if (m_Toggles.Contains(toggle))
     {
         m_Toggles.Remove(toggle);
     }
 }
 private void ValidateToggleIsInGroup(ColoredToggle toggle)
 {
     if (toggle == null || !m_Toggles.Contains(toggle))
     {
         throw new ArgumentException(string.Format("Toggle {0} is not part of ColoredToggleGroup {1}", toggle, this));
     }
 }
        public void NotifyToggleOn(ColoredToggle toggle)
        {
            ValidateToggleIsInGroup(toggle);

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

                m_Toggles[i].isOn = false;
            }
        }