SearchColumnProviderAttribute
The search column provider attribute is used to define new formats for a given column.
Read time 4 minutesLast updated 6 days ago
Definition
- Type: Class
- Namespace: UnityEditor.Search
- Assembly: UnityEditor
- Inherits from: Attribute
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]public class SearchColumnProviderAttribute : Attribute
Remarks
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);}
Properties
Property | Description |
|---|---|
| provider | Unique name of the search column provider. |