Exemplo n.º 1
0
        public void Search()
        {
            ClearHierarchy();
            var SearchString = InputField.text.ToLower();
            List <VariableViewerNetworking.NetFriendlyHierarchyBookShelf> ToShow = new List <VariableViewerNetworking.NetFriendlyHierarchyBookShelf>();

            foreach (var netFriendly in THisCompressedHierarchy)
            {
                if (netFriendly.Nm.ToLower().Contains(SearchString))
                {
                    ToShow.Add(netFriendly);
                    if (ToShow.Count > 300)
                    {
                        break;
                    }
                }
            }


            foreach (var root in ToShow)
            {
                HierarchyEntry HierarchyEntry = GethierarchyEntry();
                HierarchyEntry.transform.SetParent(RootSpace);
                HierarchyEntry.gameObject.SetActive(true);
                HierarchyEntry.SetThis(root);
                HierarchyEntry.transform.localScale = Vector3.one;
                IDtoHierarchyEntry[root.ID]         = HierarchyEntry;
                //RecursivPopulate(root);
            }
        }
Exemplo n.º 2
0
 public void PoolhierarchyEntry(HierarchyEntry hierarchyEntry)
 {
     PoolHierarchys.Enqueue(hierarchyEntry);
     hierarchyEntry.transform.SetParent(PoolHolder);
     hierarchyEntry.gameObject.SetActive(false);
     if (OpenHierarchys.Contains(hierarchyEntry))
     {
         OpenHierarchys.Remove(hierarchyEntry);
     }
 }
Exemplo n.º 3
0
        public void Refresh()
        {
            ClearHierarchy();
            IDtoHierarchyEntry.Clear();
            OpenHierarchys.Clear();
            HierarchyEntryRoots.Clear();

            foreach (var root in Roots)
            {
                HierarchyEntry HierarchyEntry = GethierarchyEntry();
                HierarchyEntry.transform.SetParent(RootSpace);
                HierarchyEntry.SetActive(true);
                HierarchyEntry.SetThis(root);
                HierarchyEntry.transform.localScale = Vector3.one;
                IDtoHierarchyEntry[root.ID]         = HierarchyEntry;
                //RecursivPopulate(root);
            }

            if (UIManager.Instance.OrNull()?.UI_BooksInBookshelf.OrNull()?.BookShelfView?.ID == null)
            {
                return;
            }
            if (IDtoBookShelves.ContainsKey(UIManager.Instance.UI_BooksInBookshelf.BookShelfView.ID))
            {
                var bookShelf = IDtoBookShelves[UIManager.Instance.UI_BooksInBookshelf.BookShelfView.ID];
                List <VariableViewerNetworking.NetFriendlyHierarchyBookShelf> passlist =
                    new List <VariableViewerNetworking.NetFriendlyHierarchyBookShelf>();
                var top = RecursiveGetParent(bookShelf, passlist);
                if (top == null)
                {
                    return;                              //In case the selected one is actually the top of hierarchy
                }
                passlist.Add(top.Shelf);
                passlist.Reverse();
                int Count = passlist.Count;
                int i     = 0;
                foreach (var NFHBS in passlist)
                {
                    if (IDtoHierarchyEntry.ContainsKey(NFHBS.ID) == false)
                    {
                        IDtoHierarchyEntry[NFHBS.PID].ChildPage = 0;
                        IDtoHierarchyEntry[NFHBS.PID].DisplayPage();
                        RecursiveUntilDisplayed(NFHBS);
                    }
                    IDtoHierarchyEntry[NFHBS.ID].ExpandChildren();
                    i++;
                    if (Count == i)
                    {
                        IDtoHierarchyEntry[NFHBS.ID].Highlight();
                    }
                }
            }
        }