Esempio n. 1
0
        private CategoryView CreateCategoryView(ArtCategory artCategory, string iconName)
        {
            if (artCategory == null)
            {
                return(null);
            }
            var categoryView = new CategoryView(artCategory, iconName);

            categories[(int)categoryView.category.artCategoryTag] = categoryView;
            return(categoryView);
        }
Esempio n. 2
0
        public GroupView(ArtGroup artGroup, string iconName)
        {
            Debug.Assert(artGroup != null);
            this.artGroup = artGroup;
            icon          = Resources.Load <Texture>(iconName);

            featureOverlays = CreateCategoryView(artGroup.FeatureOverlays, "Icons/overlay");
            navShapes       = CreateCategoryView(artGroup.NavShapes, "Icons/navigation");
            traversal       = CreateCategoryView(artGroup.Traversal, "Icons/actor");
            actorsSpawners  = CreateCategoryView(artGroup.ActorsSpawners, "Icons/actor");
            regions         = CreateCategoryView(artGroup.Regions, "Icons/region");
            splines         = CreateCategoryView(artGroup.Splines, "Icons/spline");
        }
Esempio n. 3
0
        /// <summary>
        /// Render single category
        /// </summary>
        private void RenderCategory(CategoryView categoryView)
        {
            var category = categoryView.category;

            GUILayout.BeginHorizontal();
            // -- 0 ---------------------------------------------------
            GUILayout.Box("", ButtonStyle, IconWidthOption, IconHeightOption);
            // -- 1 ---------------------------------------------------
            if (GUILayout.Button(category.IsVisible ? VisibleIcon : InvisibleIcon, ButtonStyle, IconWidthOption, IconHeightOption))
            {
                category.IsVisible = !category.IsVisible;
            }
            // -- 2 ---------------------------------------------------
            GUILayout.Box(categoryView.icon, ButtonStyle, IconWidthOption, IconHeightOption);
            // -- 3 ---------------------------------------------------
            GUILayout.Label(category.artCategoryTag.ToString(), EditorStyles.largeLabel);
            // -- 4 ---------------------------------------------------
            GUILayout.Label(categoryView.quantity.ToString(), EditorStyles.boldLabel, QuantityWidthOption);

            GUILayout.EndHorizontal();
        }