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.