Example #1
0
 protected virtual int GetIndexOfTab(TabStruct p_tab)
 {
     for (int i = 0; i < Tabs.Count; i++)
     {
         if (Tabs[i] == p_tab)
         {
             return(i);
         }
     }
     return(-1);
 }
Example #2
0
 public virtual void OnPanelOpening(TabStruct p_struct)
 {
     if (p_struct != null && p_struct.Panel != null)
     {
         if (p_struct.Toggle != null)
         {
             p_struct.Toggle.interactable = false;
         }
         SelectedTab = GetIndexOfTab(p_struct);
     }
 }
Example #3
0
 public virtual void OnPanelOpened(TabStruct p_struct)
 {
     if (p_struct != null && p_struct.Panel != null)
     {
         if (p_struct.Toggle != null)
         {
             p_struct.Toggle.interactable = true;
         }
         SelectedTab = GetIndexOfTab(p_struct);
         _needCheck  = true;
     }
 }
Example #4
0
 public virtual void OnPanelClosing(TabStruct p_struct)
 {
     if (p_struct != null && p_struct.Panel != null)
     {
         if (p_struct.Toggle != null)
         {
             p_struct.Toggle.interactable = false;
         }
         int v_newSelectedTab = GetIndexOfTab(p_struct);
         if (v_newSelectedTab == SelectedTab)
         {
             _oldSelected = SelectedTab;
             SelectedTab  = -1;
         }
     }
 }
Example #5
0
 public virtual void OnToggleChanged(TabStruct p_struct, bool p_enabled)
 {
     if (p_struct != null && p_struct.Toggle != null)
     {
         int v_newSelectedTab = GetIndexOfTab(p_struct);
         if (p_enabled)
         {
             SelectedTab = v_newSelectedTab;
             _needCheck  = true;
         }
         else
         {
             if (v_newSelectedTab == SelectedTab)
             {
                 _oldSelected = SelectedTab;
                 SelectedTab  = -1;
                 _needCheck   = true;
             }
         }
     }
 }