Version: 2021.3
言語: 日本語

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