Version: 2021.3
LanguageEnglish
  • C#

SearchProvider.CreateItem

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public Search.SearchItem CreateItem(Search.SearchContext context, string id, int score, string label, string description, Texture2D thumbnail, object data);

Declaration

public Search.SearchItem CreateItem(string id, int score, string label, string description, Texture2D thumbnail, object data);

Declaration

public Search.SearchItem CreateItem(Search.SearchContext context, string id);

Declaration

public Search.SearchItem CreateItem(string id);

Declaration

public Search.SearchItem CreateItem(string id, string label);

Declaration

public Search.SearchItem CreateItem(string id, string label, string description, Texture2D thumbnail, object data);

Declaration

public Search.SearchItem CreateItem(Search.SearchContext context, string id, string label, string description, Texture2D thumbnail, object data);

Parameters

context Search context from the query that generates this item.
id Unique ID of the search item. This is used to remove duplicates in the user view.
score Relevance score of the search item. The relevance score is used to sort all the results per search provider. Lower relevance scores indicate more relevance and are shown first.
label Relevance score of the search item. The relevance score is used to sort all the results per search provider. Lower relevance scores indicate more relevance and are shown first.
description The search item description is displayed on the second line of the search item UI widget.
thumbnail The search item thumbnail is displayed to the left of the item label and description as a preview.
data The search item thumbnail is displayed to the left of the item label and description as a preview.

Returns

SearchItem The newly created search item attached to the current search provider.

Description

Helper function to create a new search item for the current search provider.