Library/PackageCache/com.unity.quicksearch@1.6.0-preview.8/Editor/QuickSearch.cs
/// <summary>
/// Set which items are selected in the view.
/// </summary>
/// <param name="selection">List containing indices of items to select.</param>
Set which items are selected in the view.
Set which items are selected in the view .
public void SetSelection(params int[] selection)
        {
            if (!multiselect && selection.Length > 1)
                throw new Exception("Multi selection is not allowed.");
            var lastIndexAdded = k_ResetSelectionIndex;
            m_Selection.Clear();
            foreach (var idx in selection)
            {
                if (!IsItemValid(idx))
                    continue;
                m_Selection.Add(idx);
                lastIndexAdded = idx;
            }
            if (lastIndexAdded != k_ResetSelectionIndex)
                TrackSelection(lastIndexAdded);
            else
                SearchField.ResetAutoComplete();
        }
public void SetSelection ( params int [ ] selection ) { if ( ! multiselect && selection . Length > 1 ) throw new Exception ( " " ) ; var lastIndexAdded = k_ResetSelectionIndex ; m_Selection . Clear ( ) ; foreach ( var idx in selection ) { if ( ! IsItemValid ( idx ) ) continue ; m_Selection . Add ( idx ) ; lastIndexAdded = idx ; } if ( lastIndexAdded != k_ResetSelectionIndex ) TrackSelection ( lastIndexAdded ) ; else SearchField . ResetAutoComplete ( ) ; }
Set which items are selected in the view.
Set which items are selected in the view .
selection
List containing indices of items to select.
List containing indices of items to select .