SearchExpressionEvaluatorSignatureOverloadAttribute
Allows user to add more function signature overload to a SearchExpressionEvaluatorAttribute.
Read time 4 minutesLast updated 10 days ago
Definition
- Type: Class
- Namespace: UnityEditor.Search
- Assembly: UnityEditor
- Inherits from: Attribute
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]public class SearchExpressionEvaluatorSignatureOverloadAttribute : Attribute
Remarks
Here is an evaluator with 2 functional signatures:
Examples
[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;}
Constructors
Constructor | Description |
|---|---|
| SearchExpressionEvaluatorSignatureOverloadAttribute(UnityEditor.Search.SearchExpressionType[]) | Add an overload signature to an existing SearchExpressionEvaluator. |