文档

Unity Engine

Unity Engine

DoObjectField

Draw an IMGUI advanced object field.
阅读时间1 分钟最后更新于 1 个月前

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.