Version: 2019.2
public static void ShowObjectPicker (Object obj, bool allowSceneObjects, string searchFilter, int controlID);

Parameters

objThe object to be selected by default.
allowSceneObjectsIs selection of Scene objects allowed, or should it only show assets.
searchFilterDefault search filter to apply.
controlIDThe id of the control to set. This is useful if you are showing more than one of these. You can get the value at a later time.

Description

Show the object picker from code.

Once the user interacts with the Object Picker, it will respond by sending ExecuteCommand events back to the calling OnGUI that called this function. The messages are:

ObjectSelectorUpdated - The selected object was changed. The selected object can be read by calling GetObjectPickerObject ObjectSelectorClosed - The user closed the object picker.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961