Version: 2021.2
언어: 한국어

SearchColumnProviderAttribute

class in UnityEditor.Search

매뉴얼로 전환

설명

The search column provider attribute is used to define new formats for a given column.

Search column formats are equivalent to formats in a spreadsheet application. They define how the data in a column cell is manipulated and displayed.

[SearchColumnProvider("Color")]
public static void InitializeColorColumn(SearchColumn column)
{
    column.drawer = args =>
    {
        if (args.value is Color c)
            return EditorGUI.ColorField(args.rect, GUIContent.none, c, showEyedropper: false, showAlpha: true, hdr: false);
        return args.value;
    };
}

Here is an example using search column delegates to manipulate the data.

[SearchColumnProvider("GameObject/Enabled")]
public static void InitializeObjectReferenceColumn(SearchColumn column)
{
    column.getter = args => GetEnabled(args.item);
    column.drawer = args => DrawEnabled(args);
    column.setter = args => SetEnabled(args);
}

변수

providerUnique name of the search column provider.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961