CreateItem
Helper function to create a new search item for the current search provider.
Read time 5 minutesLast updated 13 days ago
Definition
- Type: Method
- Namespace: UnityEditor.Search
- Assembly: UnityEditor
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.
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.
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.
The search item description is displayed on the second line of the search item UI widget.
The search item thumbnail is displayed to the left of the item label and description as a preview.
The search item thumbnail is displayed to the left of the item label and description as a preview.
Returns
Type | Description |
|---|---|
| SearchItem | The newly created search item attached to the current search provider. |
Remarks
For different use cases see SearchProvider, SearchProvider.id, SearchProvider.isExplicitProvider, SearchProvider.priority.
CreateItem(string, int, string, string, Texture2D, Object)
Helper function to create a new search item for the current search provider.
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.
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.
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.
The search item description is displayed on the second line of the search item UI widget.
The search item thumbnail is displayed to the left of the item label and description as a preview.
The search item thumbnail is displayed to the left of the item label and description as a preview.
Returns
Type | Description |
|---|---|
| SearchItem | The newly created search item attached to the current search provider. |
Remarks
For different use cases see SearchProvider, SearchProvider.id, SearchProvider.isExplicitProvider, SearchProvider.priority.
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 |
|---|---|
| SearchItem | The newly created search item attached to the current search provider. |
Remarks
For different use cases see SearchProvider, SearchProvider.id, SearchProvider.isExplicitProvider, SearchProvider.priority.
CreateItem(string)
Helper function to create a new search item for the current search provider.
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 |
|---|---|
| SearchItem | The newly created search item attached to the current search provider. |
Remarks
For different use cases see SearchProvider, SearchProvider.id, SearchProvider.isExplicitProvider, SearchProvider.priority.
CreateItem(string, string)
Helper function to create a new search item for the current search provider.
public SearchItem CreateItem(string id, string label)
Parameters
Returns
Type | Description |
|---|---|
| SearchItem | The newly created search item attached to the current search provider. |
Remarks
For different use cases see SearchProvider, SearchProvider.id, SearchProvider.isExplicitProvider, SearchProvider.priority.
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.
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.
The search item description is displayed on the second line of the search item UI widget.
The search item thumbnail is displayed to the left of the item label and description as a preview.
The search item thumbnail is displayed to the left of the item label and description as a preview.
Returns
Type | Description |
|---|---|
| SearchItem | The newly created search item attached to the current search provider. |
Remarks
For different use cases see SearchProvider, SearchProvider.id, SearchProvider.isExplicitProvider, SearchProvider.priority.
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.
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.
The search item description is displayed on the second line of the search item UI widget.
The search item thumbnail is displayed to the left of the item label and description as a preview.
The search item thumbnail is displayed to the left of the item label and description as a preview.
Returns
Type | Description |
|---|---|
| SearchItem | The newly created search item attached to the current search provider. |
Remarks
For different use cases see SearchProvider, SearchProvider.id, SearchProvider.isExplicitProvider, SearchProvider.priority.