Version: 2023.2
言語: 日本語

SearchExpressionEvaluatorSignatureOverloadAttribute

class in UnityEditor.Search

マニュアルに切り替える

説明

Allows user to add more function signature overload to a SearchExpressionEvaluatorAttribute.

Here is an evaluator with 2 functional signatures:

[Description("Convert arguments to a string allowing you to format the result.")]
[SearchExpressionEvaluator(SearchExpressionType.Selector | SearchExpressionType.Text, SearchExpressionType.Iterable | SearchExpressionType.Literal | SearchExpressionType.Variadic)]
[SearchExpressionEvaluatorSignatureOverload(SearchExpressionType.Iterable | SearchExpressionType.Literal | SearchExpressionType.Variadic)]
public static IEnumerable<SearchItem> FormatItems(SearchExpressionContext c)
{
    var skipCount = 0;
    if (SearchExpression.GetFormatString(c.args[0], out var formatStr))
        skipCount++;
    var items = c.args.Skip(skipCount).SelectMany(e => e.Execute(c));
    var dataSet = SearchExpression.ProcessValues(items, null, item => SearchExpression.FormatItem(c.search, item, formatStr));
    return dataSet;
}

コンストラクタ

SearchExpressionEvaluatorSignatureOverloadAttributeAdd an overload signature to an existing SearchExpressionEvaluator.