| Parameter | Description |
|---|---|
| label | Optional label of the SearchItem. This will be displayed in the search Window. |
| value | Initial value of the SearchItem. |
| description | Optional description of the SearchItem. This will be displayed in the search Window. |
SearchItem Returns a new SearchItem.
Create a new SearchItem from a value with an optional label.
[Description("Returns asset paths corresponding to a list of instance ids")]
[SearchExpressionEvaluator("IdsToPaths", SearchExpressionEvaluationHints.ThreadNotSupported, SearchExpressionType.Iterable)]
public static IEnumerable<SearchItem> IdsToPath(SearchExpressionContext c)
{
foreach (var idItem in c.args[0].Execute(c))
{
if (SearchExpression.TryConvertToDouble(idItem, out var idNum))
{
var id = (int)idNum;
var path = AssetDatabase.GetAssetPath(id);
if (!string.IsNullOrEmpty(path))
{
yield return SearchExpression.CreateItem(path, c.ResolveAlias("asset path"));
}
}
}
}