Skip to content

Commit 37bbe55

Browse files
committed
Change color picker GUI into foldout
1 parent 67c5548 commit 37bbe55

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

Editor/FolderEditor.cs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
1-
using System.Threading.Tasks;
2-
using UnityEditor;
3-
using UnityEditor.Experimental;
1+
using UnityEditor;
42
using UnityEngine;
53
using UnityHierarchyFolders.Runtime;
64

7-
namespace UnityHierarchyFolders.Editor
8-
{
5+
namespace UnityHierarchyFolders.Editor {
96
[CustomEditor(typeof(Folder))]
107
public class FolderEditor : UnityEditor.Editor
118
{
12-
public override bool RequiresConstantRepaint()
13-
{
14-
return true;
15-
}
9+
private bool _expanded = false;
1610

11+
public override bool RequiresConstantRepaint() => true;
1712
public override void OnInspectorGUI()
1813
{
19-
DoIconColorPicker();
14+
_expanded = EditorGUILayout.Foldout(_expanded, "Icon Color");
15+
if (_expanded) { RenderColorPicker(); }
2016
}
2117

22-
private void DoIconColorPicker()
18+
private void RenderColorPicker()
2319
{
24-
GUILayout.Label("Icon Color", EditorStyles.boldLabel);
25-
2620
SerializedProperty colorIndexProperty = serializedObject.FindProperty("_colorIndex");
2721

2822
EditorGUILayout.BeginHorizontal();

0 commit comments

Comments
 (0)