Version: 2022.1
言語: 日本語

SearchViewState

class in UnityEditor.Search


実装インターフェース:ISerializationCallbackReceiver

マニュアルに切り替える

説明

Search view state is used to create new Search windows. See SearchService.ShowWindow.

using UnityEditor;
using UnityEditor.Search;
using UnityEngine.Search;

static class SearchWindows { [MenuItem("Search/Views/Simple Search Bar 1")] public static void SearchViewFlags1() => CreateWindow(SearchViewFlags.None); [MenuItem("Search/Views/Simple Search Bar 2")] public static void SearchViewFlags2() => CreateWindow(SearchViewFlags.EnableSearchQuery); [MenuItem("Search/Views/Simple Search Bar 3")] public static void SearchViewFlags3() => CreateWindow(SearchViewFlags.DisableInspectorPreview); [MenuItem("Search/Views/Simple Search Bar 4")] public static void SearchViewFlags4() => CreateWindow(SearchViewFlags.EnableSearchQuery | SearchViewFlags.DisableInspectorPreview);

static void CreateWindow(SearchViewFlags flags) { var searchContext = SearchService.CreateContext(string.Empty); var viewArgs = new SearchViewState(searchContext, SearchViewFlags.CompactView | flags) { title = flags.ToString() }; SearchService.ShowWindow(viewArgs); } }

変数

flagsVarious search view options.
groupIndicates the group or tab to be selected when the Search window opens.
itemSizeIndicates the item size to be used when the Search window opens.
positionIf defined, indicates the location of the new Search window when it opens.
titleIndicates the search topic title.

コンストラクタ

SearchViewStateCreate search view flags used to create a new Search window.