コード例 #1
0
        protected void Start()
        {
            // Get active state from start
            if (content)
            {
                active = content.gameObject.activeSelf;
            }
            // Find the tab windows in this tab group
            GetWindows();

            // Get starting window
            int windowCount = windows.Count;

            for (int i = 0; i < windowCount; ++i)
            {
                if (windows[i].content.gameObject.activeSelf)
                {
                    current = windows[i];
                }
            }

            ChangeTab(current);

            Toggle(active);
        }
コード例 #2
0
 /// <summary> Changes the current tab. </summary>
 /// <param name="tab">The tab window to change to.</param>
 public void ChangeTab(SM_TabWindow tab)
 {
     if (!tab)
     {
         return;
     }
     if (current)
     {
         current.Toggle(false);
     }
     current = tab;
     if (current)
     {
         current.Toggle(true);
     }
 }