Skip to content

Commit 174408e

Browse files
committed
Add folded to array list editor
Set minimum height for hex editor
1 parent 2eb9d1d commit 174408e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

UInspectorPlus/InspectorDrawer.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class InspectorDrawer {
2121
HexEdit hexEdit;
2222
List<MethodPropertyDrawer> arrayContentDrawer;
2323
ReorderableList arrayHandler;
24+
bool showListEdit;
2425

2526
public InspectorDrawer(object target, bool shown, bool showProps, bool showPrivateFields, bool showObsolete, bool showMethods) {
2627
this.target = target;
@@ -92,8 +93,8 @@ public void Draw(bool drawHeader = true, bool readOnly = false) {
9293
hexEdit = new HexEdit();
9394
hexEdit.data = target as byte[];
9495
if (hexEdit.data != null)
95-
hexEdit.DrawGUI(false, GUILayout.MinHeight(EditorGUIUtility.singleLineHeight), GUILayout.ExpandHeight(true));
96-
} else {
96+
hexEdit.DrawGUI(false, GUILayout.MinHeight(EditorGUIUtility.singleLineHeight * 3), GUILayout.ExpandHeight(true));
97+
} else if (showListEdit = EditorGUILayout.Foldout(showListEdit, string.Format("Edit List [{0} Items]", (target as IList).Count))) {
9798
if (arrayHandler == null) {
9899
if (arrayContentDrawer == null) {
99100
arrayContentDrawer = new List<MethodPropertyDrawer>();

0 commit comments

Comments
 (0)