public void RebuildIntructionsInChildren()
        {
            DisposeChildren();
            AddComponentMenuItem[] values;
            if (activeItem == null)
            {
                values = AddComponentMenuItems.GetFiltered(FilterString);
            }
            else
            {
                values = activeItem.children;
            }

            int count = values.Length;

            DrawerArrayPool.Resize(ref members, count);

            for (int n = 0; n < count; n++)
            {
                members[n] = AddComponentMenuItemDrawer.Create(values[n]);
            }
            UpdateContentRect();

            SetScrollPos(0f, false);
            SetSelectedMember(0, false);
            UpdateVisibleMembers();
        }
Beispiel #2
0
        /// <summary> Creates a new instance of the drawer or returns a reusable instance from the pool. </summary>
        /// <param name="item"> Information about the menu item. </param>
        /// <returns> The drawer instance, ready to be used. </returns>
        public static AddComponentMenuItemDrawer Create(AddComponentMenuItem item)
        {
            AddComponentMenuItemDrawer result;

            if (!DrawerPool.TryGet(out result))
            {
                result = new AddComponentMenuItemDrawer();
            }
            result.Setup(item);
            result.LateSetup();
            return(result);
        }