docs.unity.cn
    Show / Hide Table of Contents

    Class SearchSelection

    Class giving readonly access to the current list of selected items in QuickSearch.

    Inheritance
    Object
    SearchSelection
    Namespace: UnityEditor.Search
    Syntax
    public class SearchSelection : IReadOnlyCollection<SearchItem>, IEnumerable<SearchItem>, IEnumerable

    Constructors

    SearchSelection(IEnumerable<SearchItem>)

    Declaration
    public SearchSelection(IEnumerable<SearchItem> items)
    Parameters
    Type Name Description
    IEnumerable<SearchItem> items

    SearchSelection(IList<Int32>, ISearchList)

    Create a new SearchSelection

    Declaration
    public SearchSelection(IList<int> selection, ISearchList filteredItems)
    Parameters
    Type Name Description
    IList<Int32> selection

    Current list of selected SearchItem indices.

    ISearchList filteredItems

    List of SearchItem displayed in QuickSearch.

    Properties

    Count

    How many items are selected.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    Int32

    Methods

    Contains(SearchItem)

    Declaration
    public bool Contains(SearchItem item)
    Parameters
    Type Name Description
    SearchItem item
    Returns
    Type Description
    Boolean

    First()

    Get the first selected item in the selection.

    Declaration
    public SearchItem First()
    Returns
    Type Description
    SearchItem

    First select item in selection. Returns null if no item are selected

    GetEnumerator()

    Get an enumerator on the currently selected SearchItems.

    Declaration
    public IEnumerator<SearchItem> GetEnumerator()
    Returns
    Type Description
    IEnumerator<SearchItem>

    Enumerator on the currently selected SearchItems.

    Last()

    Get the last selected item in the selection.

    Declaration
    public SearchItem Last()
    Returns
    Type Description
    SearchItem

    Last select item in selection. Returns null if no item are selected

    MaxIndex()

    Highest selected index of any item in the selection.

    Declaration
    public int MaxIndex()
    Returns
    Type Description
    Int32

    Returns the highest selected index.

    MinIndex()

    Lowest selected index of any item in the selection.

    Declaration
    public int MinIndex()
    Returns
    Type Description
    Int32

    Returns the lowest selected index.

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Wednesday, October 26, 2022
    Terms of use