Version: 2023.1
言語: 日本語
public static Search.SearchItem CreateItem (string label, object value, string description);
public static Search.SearchItem CreateItem (string value, string label);
public static Search.SearchItem CreateItem (double value, string label);
public static Search.SearchItem CreateItem (int value, string label);

パラメーター

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"));
            }
        }
    }
}
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961