public static Object DoObjectField(Rect position, Object obj, Type objType, GUIContent label, SearchContext context, SearchViewFlags searchViewFlags = SearchViewFlags.None) { var id = GUIUtility.GetControlID(ObjectFieldGUI.objectFieldHash, FocusType.Keyboard, position); position = EditorGUI.PrefixLabel(position, id, label); return(ObjectFieldGUI.DoObjectField(position, position, id, obj, null, objType, null, context, searchViewFlags)); }
public static void DoObjectField(Rect position, SerializedProperty property, Type objType, GUIContent label, SearchContext context, SearchViewFlags searchViewFlags = SearchViewFlags.None) { label = EditorGUI.BeginProperty(position, label, property); var id = GUIUtility.GetControlID(ObjectFieldGUI.objectFieldHash, FocusType.Keyboard, position); position = EditorGUI.PrefixLabel(position, id, label); ObjectFieldGUI.DoObjectField(position, position, id, objType, property, null, context, searchViewFlags); EditorGUI.EndProperty(); }