Пример #1
0
 public void RegisterToggle(NewToggle toggle)
 {
     if (!m_toggles.Contains(toggle))
     {
         m_toggles.Add(toggle);
     }
 }
Пример #2
0
 public void UnregisterToggle(NewToggle toggle)
 {
     if (m_toggles.Contains(toggle))
     {
         m_toggles.Remove(toggle);
     }
 }
Пример #3
0
 private void ValidateToggles(NewToggle t)
 {
     if (t == null || !m_toggles.Contains(t))
     {
         throw new ArgumentException(string.Format("{0} is not the part of toggleGroup{1}",
                                                   new object[] { t, this }));
     }
 }
Пример #4
0
        public void NotifyToggleOn(NewToggle toggle)
        {
            ValidateToggles(toggle);

            for (int i = 0; i < m_toggles.Count; i++)
            {
                if (m_toggles[i] == toggle)
                {
                    continue;
                }
                m_toggles[i].isOn = false;
            }
        }