示例#1
0
 public void RegisterToggle(ToggleBASE toggle)
 {
     if (!m_Toggles.Contains(toggle))
     {
         m_Toggles.Add(toggle);
     }
 }
示例#2
0
 public void UnregisterToggle(ToggleBASE toggle)
 {
     if (m_Toggles.Contains(toggle))
     {
         m_Toggles.Remove(toggle);
     }
 }
示例#3
0
 private void ValidateToggleIsInGroup(ToggleBASE toggle)
 {
     if (toggle == null || !m_Toggles.Contains(toggle))
     {
         throw new ArgumentException(string.Format("Toggle {0} is not part of ToggleGroup {1}", new object[]
         {
             toggle,
         }));
     }
 }
示例#4
0
 public void NotifyToggleOn(ToggleBASE toggle, bool sendCallback = true)
 {
     ValidateToggleIsInGroup(toggle);
     for (int i = 0; i < m_Toggles.Count; i++)
     {
         if (!(m_Toggles[i] == toggle))
         {
             m_Toggles[i].Set(false, sendCallback);
         }
     }
 }