Version: 2023.1
public static void ShowSelector (Object[] targets, Presets.Preset currentSelection, bool createNewAllowed);
public static void ShowSelector (Object[] targets, Presets.Preset currentSelection, bool createNewAllowed, Action<Preset> onSelectionChanged, Action<Preset,bool> onSelectionClosed);

参数

targets The list of objects to which the selected Preset is applied.
currentSelection 打开窗口后选择的预设。如果未选择任何预设,则设置为“null”。
createNewAllowed Whether to show the 'Create New Preset...' button. Set to true to show the button. Set to false to hide this button.
onSelectionChanged Callback invoked when the selected Preset is changed. Provides the selected preset as argument.
onSelectionClosed Callback invoked when the PresetSelector window is closed. Provides as arguments the selected preset and whether or not the selction was cancelled.

描述

Opens a modal window to select a Preset.


public static Search.ISearchView ShowSelector (Presets.PresetType presetType, Presets.Preset currentSelection, SerializedProperty presetProperty, bool createNewAllowed);

参数

presetType Filters the list of Presets based on a specific PresetType.
currentSelection 打开窗口后选择的预设。如果未选择任何预设,则设置为“null”。
presetProperty The SerializedProperty behind an ObjectField used to select preset assets.
createNewAllowed Whether to show the 'Create New Preset...' button. Set to true to show the button. Set to false to hide this button.

返回

ISearchView Returns the search view.

描述

Opens a modal window to select a Preset from an object field backed by a SerializedProperty.


Obsolete public static void ShowSelector (Object target, Presets.Preset currentSelection, bool createNewAllowed, PresetSelectorReceiver eventReceiver);
Obsolete public static void ShowSelector (Presets.PresetType presetType, Presets.Preset currentSelection, bool createNewAllowed, PresetSelectorReceiver eventReceiver);

参数

target 用于确定要选择的预设资源类型的对象。模态窗口根据此对象对选择器视图进行过滤。
currentSelection 打开窗口后选择的预设。如果未选择任何预设,则设置为“null”。
createNewAllowed Whether to show the 'Create New Preset...' button. Set to true to show the button. Set to false to hide this button.
eventReceiver PresetSelector 用于发送事件的 PresetSelectorReceiver 实例。
presetType 基于特定 PresetType 筛选预设列表。使用此参数可在未指定目标时设置 PresetType。

描述

OBSOLETE. Opens a modal window to select a Preset.