示例#1
0
        public override void Draw()
        {
            foldout = EditorGUILayout.Foldout(foldout, FOLD_NAME);

            if (!foldout)
            {
                return;
            }

            HierarchyUtil.CreateGroup(() =>
            {
                HierarchyUtil.CreateInfo(INFO);

                this.enabled = HierarchyUtil.Toggle("Enabeld", this.enabled,
                                                    @"Enable/Disable all features from this section");

                HierarchyUtil.BeginHorizontal(() =>
                {
                    this.prefix = HierarchyUtil.TextField("Prefix", this.prefix,
                                                          @"Prefix string for separator in GameObject's name");
                    HierarchyUtil.Button("Reset", ResetPrefix);
                });

                HierarchyUtil.BeginHorizontal(() =>
                {
                    this.color = HierarchyUtil.ColorField("Color", this.color,
                                                          @"Color of the separator");
                    HierarchyUtil.Button("Reset", ResetColor);
                });

                this.drawFill = HierarchyUtil.Toggle("Draw Fill", this.drawFill,
                                                     @"Draw separator from start all the way to the end");
            });
        }
示例#2
0
        public override void Draw()
        {
            foldout = EditorGUILayout.Foldout(foldout, FOLD_NAME);

            if (!foldout)
            {
                return;
            }

            HierarchyUtil.CreateGroup(() =>
            {
                HierarchyUtil.CreateInfo(INFO);

                this.enabled = HierarchyUtil.Toggle("Enabeld", this.enabled,
                                                    @"Enable/Disable all features from this section");

                HierarchyUtil.BeginHorizontal(() =>
                {
                    this.color = HierarchyUtil.ColorField("Color", this.color,
                                                          @"Color for odd row");
                    HierarchyUtil.Button("Reset", ResetColor);
                });

                this.drawFill = HierarchyUtil.Toggle("Draw Fill", this.drawFill,
                                                     @"Draw the row entirely to the left");
            });
        }
示例#3
0
        public override void Draw()
        {
            foldout = EditorGUILayout.Foldout(foldout, FOLD_NAME);

            if (!foldout)
            {
                return;
            }

            HierarchyUtil.CreateGroup(() =>
            {
                HierarchyUtil.CreateInfo(INFO);

                this.enabled = HierarchyUtil.Toggle("Enabeld", this.enabled,
                                                    @"Enable/Disable all features from this section");

                HierarchyUtil.LabelField("Bar");

                HierarchyUtil.CreateGroup(() =>
                {
                    HierarchyUtil.CreateInfo("Colorized Bar by tree level");

                    this.colorizedLine = HierarchyUtil.Toggle("Colorized Line", this.colorizedLine,
                                                              @"Enabled/Disabled to colorized bar");

                    HierarchyUtil.BeginHorizontal(() =>
                    {
                        this.lineAlpha = HierarchyUtil.Slider("Line Alpha", this.lineAlpha, 0.0f, 1.0f,
                                                              @"Alpha level for the bar");
                        HierarchyUtil.Button("Reset", ResetLineAlpha);
                    });

                    HierarchyUtil.BeginHorizontal(() =>
                    {
                        this.lineWidth = HierarchyUtil.Slider("Line Width", this.lineWidth, 0.001f, 3.0f,
                                                              @"Line width for the bar");
                        HierarchyUtil.Button("Reset", ResetLineWidth);
                    });
                });

                HierarchyUtil.LabelField("Item");

                HierarchyUtil.CreateGroup(() =>
                {
                    HierarchyUtil.CreateInfo("Colorized Item by tree level");

                    this.colorizedItem = HierarchyUtil.Toggle("Colorized Item", this.colorizedItem,
                                                              @"Enabled/Disabled to colorized item");

                    this.drawMode = (DrawMode)HierarchyUtil.EnumPopup("Draw Mode", this.drawMode,
                                                                      @"Mode for item to draw");

                    HierarchyUtil.BeginHorizontal(() =>
                    {
                        this.gradientLength = HierarchyUtil.Slider("Gradient Length", this.gradientLength, 0.01f, 1.0f,
                                                                   @"Time of the gradient faded to alpha 0");
                        HierarchyUtil.Button("Reset", ResetGradientLength);
                    });

                    HierarchyUtil.BeginHorizontal(() =>
                    {
                        this.overlayAlpha = HierarchyUtil.Slider("Overlay Alpha", this.overlayAlpha, 0.0f, 0.8f,
                                                                 @"Alpha level for the item");
                        HierarchyUtil.Button("Reset", ResetOverlayAlpha);
                    });

                    HierarchyUtil.BeginHorizontal(() =>
                    {
                        this.baseLevelColor = HierarchyUtil.ColorField("Base Level Color", this.baseLevelColor,
                                                                       @"Base color for colorized item");
                        HierarchyUtil.Button("Reset", ResetBaseLevelColor);
                    });

                    HierarchyUtil.BeginHorizontal(() =>
                    {
                        instance         = ScriptableObject.CreateInstance <Container_TreeData>();
                        serializedObject = new SerializedObject(instance);
                        propBranches     = serializedObject.FindProperty("branches");

                        DynamicRefresh();

                        serializedObject.Update();
                        EditorGUILayout.PropertyField(propBranches);
                        serializedObject.ApplyModifiedProperties();

                        HierarchyUtil.Button("Reset", ResetBranchesColor);
                    });
                });

                HierarchyUtil.LabelField("Divider");

                HierarchyUtil.CreateGroup(() =>
                {
                    HierarchyUtil.CreateInfo("Thin lines indicate each group of tree level");

                    HierarchyUtil.BeginHorizontal(() =>
                    {
                        this.dividerColor = HierarchyUtil.ColorField("Color", this.dividerColor,
                                                                     @"Color for the divider");
                        HierarchyUtil.Button("Reset", ResetDividerColor);
                    });

                    HierarchyUtil.BeginHorizontal(() =>
                    {
                        this.dividerHeight = HierarchyUtil.Slider("Divider Height", this.dividerHeight, 0.0f, 3.0f,
                                                                  @"Height of the divider");
                        HierarchyUtil.Button("Reset", ResetDividerHeight);
                    });
                });
            });
        }
示例#4
0
        public override void Draw()
        {
            foldout = EditorGUILayout.Foldout(foldout, FOLD_NAME);

            if (!foldout)
            {
                return;
            }

            HierarchyUtil.CreateGroup(() =>
            {
                HierarchyUtil.CreateInfo(INFO);

                this.enabled = HierarchyUtil.Toggle("Enabeld", this.enabled,
                                                    @"Enable/Disable all features from this section");

                HierarchyUtil.LabelField("Text");

                HierarchyUtil.CreateGroup(() =>
                {
                    HierarchyUtil.CreateInfo("Show Tag name");

                    this.enabledText = HierarchyUtil.Toggle("Enabeld", this.enabledText,
                                                            @"Display text on the side");

                    HierarchyUtil.BeginHorizontal(() =>
                    {
                        this.textColorUntagged = HierarchyUtil.ColorField("Untagged Color", this.textColorUntagged,
                                                                          @"Color for layer, Untagged");
                        HierarchyUtil.Button("Reset", ResetTextUntaggedColor);
                    });

                    HierarchyUtil.BeginHorizontal(() =>
                    {
                        this.textColor = HierarchyUtil.ColorField("Color", this.textColor,
                                                                  @"Text color for other meaningful tags");
                        HierarchyUtil.Button("Reset", ResetTextColor);
                    });
                });

                HierarchyUtil.LabelField("Item");

                HierarchyUtil.CreateGroup(() =>
                {
                    HierarchyUtil.CreateInfo("Colorized Item");

                    this.enabledItem = HierarchyUtil.Toggle("Enabeld", this.enabledItem,
                                                            @"Colorized items in hierarchy");

                    HierarchyUtil.BeginHorizontal(() =>
                    {
                        HierarchyUtil.LabelField("Colors", @"Color mapping for each tag");
                        HierarchyUtil.Button("Add", AddTagColor);
                    });

                    HierarchyUtil.CreateGroup(() =>
                    {
                        string[] tags = InternalEditorUtility.tags;

                        int drawn = 0;

                        for (int count = 0; count < itemColors.Count; ++count)
                        {
                            string oldName   = itemColors.Keys.ElementAt(count);
                            int oldSelection = TagToIndex(oldName);

                            HierarchyUtil.BeginHorizontal(() =>
                            {
                                int currentSelection = HierarchyUtil.Popup(oldSelection, tags);
                                string currentName   = IndexToTag(currentSelection);

                                Color col = HierarchyUtil.ColorField("", itemColors[oldName],
                                                                     @"Color for this tag, " + currentName);

                                RemoveTagColor(oldName);
                                if (itemColors.ContainsKey(currentName))
                                {
                                    itemColors[currentName] = col;
                                }
                                else
                                {
                                    itemColors.Add(currentName, col);
                                }

                                if (HierarchyUtil.Button("Remove"))
                                {
                                    RemoveTagColor(currentName);
                                }

                                ++drawn;
                            });
                        }

                        if (drawn == 0)
                        {
                            EditorGUILayout.LabelField("No specification");
                        }
                    });

                    HierarchyUtil.BeginHorizontal(() =>
                    {
                        this.gradientLength = HierarchyUtil.Slider("Gradient Length", this.gradientLength, 0.01f, 1.0f,
                                                                   @"Time of the gradient faded to alpha 0");
                        HierarchyUtil.Button("Reset", ResetGradientLength);
                    });

                    this.invertDirection = HierarchyUtil.Toggle("Invert", this.invertDirection,
                                                                @"Invert the gradient direction");
                });
            });
        }