I have custom PropertyDrawer with SearchField. It works fine. But when I try to draw it’s via EditorGUILayout.PropertyField input not work (?). What’s wrong?
Unity 2019.3.3f1
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
// "entity" is a "EntityDrawer" with "SearchField"
var field = target.GetType().GetField("entity");
if (field == null)
{
Debug.LogError("Field 'entity' not found");
return;
}
serializedObject.Update();
EditorGUI.BeginChangeCheck();
{
var property = serializedObject.FindProperty(field.Name);
if (property != null)
EditorGUILayout.PropertyField(property, true);
}
if (EditorGUI.EndChangeCheck())
serializedObject.ApplyModifiedProperties();
}
(code from RuleTile)