Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


DoObjectField

Draw an IMGUI advanced object field.
Read time 1 minuteLast updated 10 days ago

Definition

DoObjectField(Rect, SerializedProperty, Type, GUIContent, SearchContext, SearchViewFlags)

Draw an IMGUI advanced object field.
public static void DoObjectField(Rect position, SerializedProperty property, Type objType, GUIContent label, SearchContext context, SearchViewFlags searchViewFlags = SearchViewFlags.None)

Parameters

position

Position to draw the control in the current view.

Serialized property holding the selected object.

objType

Type of the object to be picked.

Label displayed left of the control.

Search context used to open the advanced search picker.

searchViewFlags

Search view flags used to open the advanced search picker.

DoObjectField(Rect, Object, Type, GUIContent, SearchContext, SearchViewFlags)

Draw an IMGUI advanced object field.
public static Object DoObjectField(Rect position, Object obj, Type objType, GUIContent label, SearchContext context, SearchViewFlags searchViewFlags = SearchViewFlags.None)

Parameters

position

Position to draw the control in the current view.

Currently selected object.

objType

Type of the object to be picked.

Label displayed left of the control.

Search context used to open the advanced search picker.

searchViewFlags

Search view flags used to open the advanced search picker.

Returns

Type

Description

ObjectReturns the selected object.