Skip to main content

EditorWindowGizmosDrawer

A class in Root.Township, the global namespace.

Hidden object that lets non-scene code draw gizmos: register a callback and it is run from OnDrawGizmos.

Constructors​

MemberWhat it is
EditorWindowGizmosDrawer()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

1 private and internal field
MemberWhat it is
private static EditorWindowGizmosDrawer sceneDrawerThe hidden drawer instance.

Events​

1 private and internal event
MemberWhat it is
private static event Action gizmosCallbackThe registered gizmo callbacks.

Methods​

MemberWhat it is
static void DeregisterCallback(Action callback)Removes a gizmo callback.
static void RegisterCallback(Action callback)Adds a callback once, creating the hidden drawer object if needed.
1 private and internal method
MemberWhat it is
private void OnDrawGizmos()Runs the callbacks, or destroys the drawer object when none are left.