RegisterCustomHandler(string, Action<string, EntityId[]>, Func<string, EditorWindow, bool>)
Registers a handler for custom non-Object based selection in selection history.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor.CoreModule
public static void RegisterCustomHandler(string key, Action<string, EntityId[]> handler, Func<string, EditorWindow, bool> validator = null)
Parameters
A unique string that identifies the selection handler.
A function that handles custom non-Object based selection in selection history.
A function that validates custom non-Object based selection in selection history. Use the Validator to confirm that the given selection represented by is still valid within the given window (optional).
customDataRemarks
The Editor's selection history normally tracks only regular Object-based selection. If you have an Editor window or an Editor tool that has a custom "selection" concept and you want that to participate in the selection history, use Selection.RegisterCustomHandler and Selection.SetCustomSelection. Unity calls this handler when a user navigates back to a selection entry that was recorded with Selection.SetCustomSelection. The handler decodes the custom selection data from string, and can optionally use the passed EntityIDs. Additional Resources: Selection.RegisterCustomHandler, Selection.SetCustomSelection.
customDataselectedObjects