Exemplo n.º 1
0
        private void OnEnable()
        {
            if (collection == null || tabPreFab == null)
            {
                return;
            }

            foreach (HelpEntry entry in entries)
            {
                Destroy(entry.gameObject);
            }
            entries.Clear();

            if (tabPreFab == null)
            {
                return;
            }

            SetUpTabs();
            SetUpSubTabs();
            tabPreFab.SetActive(false);

            HelpEntry first = entries.FirstOrDefault();

            if (!first)
            {
                return;
            }
            first.GetComponentInChildren <Selectable>().Select();
            AlterPage(first.tab.page);
        }
Exemplo n.º 2
0
 private void SetUpSubTabs()
 {
     foreach (HelpEntry tabUi in entries)
     {
         foreach (Tab subTab in tabUi.tab.subTabs)
         {
             HelpEntry subHelpEntry = entries.Find(t => t.tab == subTab);
             if (subHelpEntry != null)
             {
                 subHelpEntry.transform.SetParent(tabUi.SubTabObj.transform);
             }
         }
     }
 }