1.8.1: Fixed issue with certain drawers using EditorGUI.PropertyField, which would invoke a second draw with the same attribute
This commit is contained in:
parent
eb19150d98
commit
b189ec8b97
|
|
@ -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"))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ namespace Module.Inspector.Editor
|
|||
|
||||
return "Unknown error";
|
||||
}
|
||||
|
||||
|
||||
private static ESupportType IsSupported(SerializedProperty property)
|
||||
{
|
||||
if (property.propertyType != SerializedPropertyType.ManagedReference)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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`
|
||||
* Optional attribute for fields, if `EnableShowHiddenFields` has parameter `true`
|
||||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue