diff --git a/Editor/Drawers/FilePathAttributeDrawer.cs b/Editor/Drawers/FilePathAttributeDrawer.cs index e312c12..dc9af9c 100644 --- a/Editor/Drawers/FilePathAttributeDrawer.cs +++ b/Editor/Drawers/FilePathAttributeDrawer.cs @@ -20,8 +20,10 @@ namespace Module.Inspector.Editor var rect0 = new Rect(position.x, position.y, position.width - WIDTH, position.height); var rect1 = new Rect(rect0.xMax, position.y, WIDTH, position.height); - - EditorGUI.PropertyField(rect0, property, label); + string temp = EditorGUI.TextField(rect0, label, property.stringValue); + + if (!temp.Equals(property.stringValue)) + property.stringValue = temp; if (GUI.Button(rect1, "Find")) { diff --git a/Editor/Drawers/FolderPathAttributeDrawer.cs b/Editor/Drawers/FolderPathAttributeDrawer.cs index 175d849..8d20c66 100644 --- a/Editor/Drawers/FolderPathAttributeDrawer.cs +++ b/Editor/Drawers/FolderPathAttributeDrawer.cs @@ -20,9 +20,11 @@ namespace Module.Inspector.Editor var rect0 = new Rect(position.x, position.y, position.width - WIDTH, position.height); var rect1 = new Rect(rect0.xMax, position.y, WIDTH, position.height); - - EditorGUI.PropertyField(rect0, property, label); + string temp = EditorGUI.TextField(rect0, label, property.stringValue); + if (!temp.Equals(property.stringValue)) + property.stringValue = temp; + if (GUI.Button(rect1, "Find")) { string path = EditorUtility.OpenFolderPanel("Folder", "Assets/", string.Empty); diff --git a/Editor/Drawers/SerializeReferenceToAttributeDrawer.cs b/Editor/Drawers/SerializeReferenceToAttributeDrawer.cs index 37c313d..eb9ad1f 100644 --- a/Editor/Drawers/SerializeReferenceToAttributeDrawer.cs +++ b/Editor/Drawers/SerializeReferenceToAttributeDrawer.cs @@ -84,7 +84,7 @@ namespace Module.Inspector.Editor return "Unknown error"; } - + private static ESupportType IsSupported(SerializedProperty property) { if (property.propertyType != SerializedPropertyType.ManagedReference) diff --git a/Editor/Drawers/StringToFieldAttributeDrawer.cs b/Editor/Drawers/StringToFieldAttributeDrawer.cs index b673a97..1278eb5 100644 --- a/Editor/Drawers/StringToFieldAttributeDrawer.cs +++ b/Editor/Drawers/StringToFieldAttributeDrawer.cs @@ -20,8 +20,10 @@ namespace Module.Inspector.Editor var rect0 = new Rect(position.x, position.y, position.width - WIDTH, position.height); var rect1 = new Rect(rect0.xMax, position.y, WIDTH, position.height); - - EditorGUI.PropertyField(rect0, property, label); + string temp = EditorGUI.TextField(rect0, label, property.stringValue); + + if (!temp.Equals(property.stringValue)) + property.stringValue = temp; if (GUI.Button(rect1, "Find")) EditorWindowStringToField.Open(att.type, property); diff --git a/Editor/Drawers/StringToTypeAttributeDrawer.cs b/Editor/Drawers/StringToTypeAttributeDrawer.cs index 314b4c6..315d2f4 100644 --- a/Editor/Drawers/StringToTypeAttributeDrawer.cs +++ b/Editor/Drawers/StringToTypeAttributeDrawer.cs @@ -20,12 +20,13 @@ namespace Module.Inspector.Editor var rect0 = new Rect(position.x, position.y, position.width - WIDTH, position.height); var rect1 = new Rect(rect0.xMax, position.y, WIDTH, position.height); - - EditorGUI.PropertyField(rect0, property, label); + string temp = EditorGUI.TextField(rect0, label, property.stringValue); + + if (!temp.Equals(property.stringValue)) + property.stringValue = temp; if (GUI.Button(rect1, "Find")) EditorWindowStringToType.Open(att.assignableFrom, property); - } EditorGUI.EndProperty(); return true; diff --git a/Editor/Extensions/SerializedPropertyExtension.cs b/Editor/Extensions/SerializedPropertyExtension.cs index 7210f56..d00a36d 100644 --- a/Editor/Extensions/SerializedPropertyExtension.cs +++ b/Editor/Extensions/SerializedPropertyExtension.cs @@ -526,7 +526,7 @@ namespace Module.Inspector.Editor case SerializedPropertyType.BoundsInt: return property.boundsIntValue.ToString(); case SerializedPropertyType.ManagedReference: - return property.objectReferenceValue != null ? property.objectReferenceValue.ToString() : "null"; + return property.managedReferenceValue != null ? property.managedReferenceValue.ToString() : "null"; } return "Unable to draw value as string"; diff --git a/README.md b/README.md index dc309b5..b213b17 100644 --- a/README.md +++ b/README.md @@ -171,6 +171,6 @@ List of all decorator attributes: To allow fields hidden from inspector either by `NonSerialized` or `HideInInspector` add the following to the class: * `EnableShowHiddenFields` - * Enables an additional search to find any "hidden" fields and draw them below `DefaultInspector` + * Enables an additional search to find any "hidden" fields and draw them below `DefaultInspector` * `ShowHiddenField` - * Optional attribute for fields, if `EnableShowHiddenFields` has parameter `true` \ No newline at end of file + * Optional attribute for fields, if `EnableShowHiddenFields` has parameter `true` \ No newline at end of file diff --git a/package.json b/package.json index 82b047e..415854b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.module.inspector", - "version": "1.8.0", + "version": "1.8.1", "displayName": "Module.Inspector", "description": "Custom inspector with various useful property drawers", "unity": "2019.2",