private IEnumerator <YieldInstruction> show_subnodes()
 {
     if (info == null)
     {
         yield break;
     }
     subnodesToggle.interactable = false;
     foreach (var childInfo in info.GetChildren())
     {
         add_subnode(childInfo);
         yield return(null);
     }
     subnodes.gameObject.SetActive(true);
     subnodesToggle.interactable = true;
 }
Exemple #2
0
 private void show_subnodes(bool show)
 {
     if (show)
     {
         if (info != null)
         {
             foreach (var childInfo in info.GetChildren())
             {
                 add_subnode(childInfo);
             }
             subnodes.gameObject.SetActive(true);
         }
     }
     else
     {
         children.Clear();
         subnodes.gameObject.SetActive(false);
         for (var i = subnodes.childCount - 1; i >= 0; i--)
         {
             Destroy(subnodes.GetChild(i).gameObject);
         }
     }
 }
        private static IEnumerator <YieldInstruction> find_children(
            IRecyclable recyclable,
            string named_like,
            HashSet <uint> show_subnode_ids
            )
        {
            var show = recyclable.Name.ToLowerInvariant().Contains(named_like);

            foreach (var child in recyclable.GetChildren())
            {
                var child_coro = find_children(child, named_like, show_subnode_ids);
                while (child_coro.MoveNext())
                {
                    yield return(child_coro.Current);
                }
                show |= show_subnode_ids.Contains(child.ID);
            }
            if (show)
            {
                show_subnode_ids.Add(recyclable.ID);
            }
            yield return(null);
        }