Version: 2021.3
언어: 한국어

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.