Exemplo n.º 1
0
 public void RegisterToggle(ToggleEX toggle)
 {
     if (!m_Toggles.Contains(toggle))
     {
         m_Toggles.Add(toggle);
     }
 }
Exemplo n.º 2
0
 public void UnregisterToggle(ToggleEX toggle)
 {
     if (m_Toggles.Contains(toggle))
     {
         m_Toggles.Remove(toggle);
     }
 }
Exemplo n.º 3
0
 private void ValidateToggleIsInGroup(ToggleEX 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 }));
     }
 }
Exemplo n.º 4
0
        public void NotifyToggleOn(ToggleEX toggle)
        {
            ValidateToggleIsInGroup(toggle);

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

                m_Toggles[i].isOn = false;
            }
        }
Exemplo n.º 5
0
        public void IndexToggleOn(int index)
        {
            ToggleEX target = togglesByIndex[index];

            target.isOn = true;
            // disable all toggles in the group
            for (int i = 0; i < togglesByIndex.Count; i++)
            {
                if (togglesByIndex[i] == target)
                {
                    continue;
                }

                togglesByIndex[i].isOn = false;
            }
        }