Version: 2022.2
言語: 日本語

SearchSelectorAttribute

class in UnityEditor.Search

マニュアルに切り替える

説明

Search selector attribute used to define how a custom value can be selected from a search item.

Here's an example to select the number of line of code of text assets. > select{p: *.cs, @path, @loc}.

[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; }

変数

cacheableSet the cacheable property if you do not want the search backend to pull cached values from the property database.