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);
|
||||
string temp = EditorGUI.TextField(rect0, label, property.stringValue);
|
||||
|
||||
EditorGUI.PropertyField(rect0, property, label);
|
||||
if (!temp.Equals(property.stringValue))
|
||||
property.stringValue = temp;
|
||||
|
||||
if (GUI.Button(rect1, "Find"))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
string temp = EditorGUI.TextField(rect0, label, property.stringValue);
|
||||
|
||||
EditorGUI.PropertyField(rect0, property, label);
|
||||
if (!temp.Equals(property.stringValue))
|
||||
property.stringValue = temp;
|
||||
|
||||
if (GUI.Button(rect1, "Find"))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
string temp = EditorGUI.TextField(rect0, label, property.stringValue);
|
||||
|
||||
EditorGUI.PropertyField(rect0, property, label);
|
||||
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);
|
||||
string temp = EditorGUI.TextField(rect0, label, property.stringValue);
|
||||
|
||||
EditorGUI.PropertyField(rect0, property, label);
|
||||
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";
|
||||
|
|
|
|||
|
|
@ -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