SearchSelectorAttribute
Search selector attribute used to define how a custom value can be selected from a search item.
Read time 3 minutesLast updated 5 days ago
Definition
- Type: Class
- Namespace: UnityEditor.Search
- Assembly: UnityEditor
- Inherits from: Attribute
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]public class SearchSelectorAttribute : Attribute
Remarks
Here's an example to select the number of line of code of text assets.
select{p: *.cs, @path, @loc}.
Examples
[SearchSelector("loc", provider: "asset")]static object SelectLineOfCode(SearchSelectorArgs args){ TextAsset textAsset = args.current.ToObject<TextAsset>(); if (textAsset) return textAsset.text.Split('\n').Length; return null;}
Properties
Property | Description |
|---|---|
| cacheable | Set the cacheable property if you do not want the search backend to pull cached values from the property database. |