예제 #1
0
        /// <inheritdoc/>
        protected override void DoGenerateMemberBuildList()
        {
            base.DoGenerateMemberBuildList();

            ClearCategorizedBuildList();

            for (int n = 0, count = memberBuildList.Count; n < count; n++)
            {
                var    memberComponents = memberBuildList[n];
                var    firstComponent   = memberComponents[0];
                string category;
                if (firstComponent == null)
                {
                    category = "Missing Scripts";
                }
                else
                {
                    category = ComponentCategories.Get(firstComponent);
                }
                List <Component[]> componentsUnderCategory;
                if (!categorizedBuildList.TryGetValue(category, out componentsUnderCategory))
                {
                    componentsUnderCategory = GetEmptyListOfComponentArrays();
                    categorizedBuildList.Add(category, componentsUnderCategory);
                }
                componentsUnderCategory.Add(memberComponents);
            }
        }
예제 #2
0
        /// <inheritdoc/>
        public override void AddComponentMember(int memberIndex, [NotNull] IComponentDrawer componentDrawer)
        {
            var category = ComponentCategories.Get(componentDrawer.Component);

                        #if DEV_MODE
            Debug.Log("AddComponentMember(" + memberIndex + ", " + componentDrawer.GetType().Name + ") category=\"" + category + "\", members.Length=" + members.Length);
                        #endif

            var categoryDrawer = GetOrCreateCategoryDrawer(category);

            if (categoryDrawer == null)
            {
                var setMembers = members;

                if (memberIndex == -1)
                {
                    memberIndex = setMembers.Length - LastCollectionMemberCountOffset + 1;
                }
                DrawerArrayPool.InsertAt(ref setMembers, memberIndex, componentDrawer, false);
                SetMembers(setMembers);
                return;
            }

            var setCategoryMembers = categoryDrawer.Members;
            DrawerArrayPool.InsertAt(ref setCategoryMembers, setCategoryMembers.Length, componentDrawer, false);
            categoryDrawer.SetMembers(setCategoryMembers);
        }
예제 #3
0
        protected CategorizedComponentsDrawer GetOrCreateCategoryDrawer(Component component)
        {
            var category = ComponentCategories.Get(component);

            return(GetOrCreateCategoryDrawer(category));
        }
예제 #4
0
 private void RebuildComponentCategories()
 {
     ComponentCategories.Rebuild(componentCategories, generateFromAddComponentMenu);
     RebuildInspectorDrawers();
 }