Library/PackageCache/com.unity.quicksearch@1.6.0-preview.8/Editor/SearchProvider.cs
/// <summary>
/// Helper function to create a new search item for the current provider.
/// </summary>
/// <param name="id">Unique id of the search item. This is used to remove duplicates to the user view.</param>
/// <param name="score">Score of the search item. The score is used to sort all the result per provider. Lower score are shown first.</param>
/// <param name="label">The search item label is displayed on the first line of the search item UI widget.</param>
/// <param name="description">The search item description is displayed on the second line of the search item UI widget.</param>
/// <param name="thumbnail">The search item thumbnail is displayed left to the item label and description as a preview.</param>
/// <param name="data">User data used to recover more information about a search item. Generally used in fetchLabel, fetchDescription, etc.</param>
/// <returns>The newly created search item attached to the current search provider.</returns>
Helper function to create a new search item for the current provider.
Helper function to create a new search item for the current provider .
public SearchItem CreateItem(SearchContext context, string id, int score, string label, string description, Texture2D thumbnail, object data)
        {
            #if false 
            description = $"DEBUG: id={id} - label={label} - description={description} - thumbnail={thumbnail} - data={data}";
            label = $"{label ?? id} ({score})";
            #endif
            return new SearchItem(id)
            {
                score = score,
                label = label,
                description = description,
                options = SearchItemOptions.Highlight | SearchItemOptions.Ellipsis,
                thumbnail = thumbnail,
                data = data,
                provider = this,
                context = context
            };
        }
public SearchItem CreateItem ( SearchContext context , string id , int score , string label , string description , Texture2D thumbnail , object data ) { if false description = $" DEBUG: id= { id }  - label= { label }  - description= { description }  - thumbnail= { thumbnail }  - data= { data } " ; label = $" { label ?? id }  ( { score } ) " ; endif return new SearchItem ( id ) { score = score , label = label , description = description , options = SearchItemOptions . Highlight | SearchItemOptions . Ellipsis , thumbnail = thumbnail , data = data , provider = this , context = context } ; }
Helper function to create a new search item for the current provider.
Helper function to create a new search item for the current provider .
// Debug sorting
The newly created search item attached to the current search provider.
The newly created search item attached to the current search provider .
context
SearchContext
id
string
Unique id of the search item. This is used to remove duplicates to the user view.
Unique id of the search item . This is used to remove duplicates to the user view .
score
int
Score of the search item. The score is used to sort all the result per provider. Lower score are shown first.
Score of the search item . The score is used to sort all the result per provider . Lower score are shown first .
label
string
The search item label is displayed on the first line of the search item UI widget.
The search item label is displayed on the first line of the search item UI widget .
description
string
The search item description is displayed on the second line of the search item UI widget.
The search item description is displayed on the second line of the search item UI widget .
thumbnail
Texture2D
The search item thumbnail is displayed left to the item label and description as a preview.
The search item thumbnail is displayed left to the item label and description as a preview .
data
object
User data used to recover more information about a search item. Generally used in fetchLabel, fetchDescription, etc.
User data used to recover more information about a search item . Generally used in fetchLabel fetchDescription etc .