Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


CreateItem

Helper function to create a new search item for the current search provider.
Read time 5 minutesLast updated 13 days ago

Definition

CreateItem(SearchContext, string, int, string, string, Texture2D, Object)

Helper function to create a new search item for the current search provider.
public SearchItem CreateItem(SearchContext context, string id, int score, string label, string description, Texture2D thumbnail, object data)

Parameters

Search context from the query that generates this item.

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

Type

Description

SearchItemThe newly created search item attached to the current search provider.

Remarks

CreateItem(string, int, string, string, Texture2D, Object)

Helper function to create a new search item for the current search provider.
Warning
Deprecated. Use CreateItem which take a SearchContext
public SearchItem CreateItem(string id, int score, string label, string description, Texture2D thumbnail, object data)

Parameters

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

Type

Description

SearchItemThe newly created search item attached to the current search provider.

Remarks

CreateItem(SearchContext, string)

Helper function to create a new search item for the current search provider.
public SearchItem CreateItem(SearchContext context, string id)

Parameters

Search context from the query that generates this item.

Unique ID of the search item. This is used to remove duplicates in the user view.

Returns

Type

Description

SearchItemThe newly created search item attached to the current search provider.

Remarks

CreateItem(string)

Helper function to create a new search item for the current search provider.
Warning
Deprecated. Use CreateItem which take a SearchContext
public SearchItem CreateItem(string id)

Parameters

Unique ID of the search item. This is used to remove duplicates in the user view.

Returns

Type

Description

SearchItemThe newly created search item attached to the current search provider.

Remarks

CreateItem(string, string)

Helper function to create a new search item for the current search provider.
Warning
Deprecated. Use CreateItem which take a SearchContext
public SearchItem CreateItem(string id, string label)

Parameters

Unique ID of the search item. This is used to remove duplicates in the user view.

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.

Returns

Type

Description

SearchItemThe newly created search item attached to the current search provider.

Remarks

CreateItem(string, string, string, Texture2D, Object)

Helper function to create a new search item for the current search provider.
public SearchItem CreateItem(string id, string label, string description, Texture2D thumbnail, object data)

Parameters

Unique ID of the search item. This is used to remove duplicates in the user view.

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

Type

Description

SearchItemThe newly created search item attached to the current search provider.

Remarks

CreateItem(SearchContext, string, string, string, Texture2D, Object)

Helper function to create a new search item for the current search provider.
public SearchItem CreateItem(SearchContext context, string id, string label, string description, Texture2D thumbnail, object data)

Parameters

Search context from the query that generates this item.

Unique ID of the search item. This is used to remove duplicates in the user view.

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

Type

Description

SearchItemThe newly created search item attached to the current search provider.

Remarks