Skip to content
Bit Quirky Behavior Trees and
State Machines

Search documentation

All topics and APIs

Close returns focus to Search.

What are you looking for?

Try a common topic or enter a complete API identifier.

Browse the reference instead

Esc closes · Tab reaches results · Enter opens the focused link

v0.6.0
Menu

BitQuirky.Graph.GraphView.Automation

Public bit quirky graph: editor symbols in BitQuirky.Graph.GraphView.Automation.

Source snapshot ad0983d00d77.

Assembly: BitQuirky.Graph.GraphView.Editor

Category: Low-level runtime

C#
class BitQuirky.Graph.GraphView.Automation.AutomatedEditorWindowHost

Source declaration: ../bitquirky-graph/Editor/GraphView/Automation/AutomatedEditorWindowHost.cs:41-635

The one way automated Editor runs open, frame, and close their windows.

Responsibilities:

  • Dock every automated window as a tab in the main Unity window beside the Scene view, the same anchoring the graph windows use for their own open, so a run never adds a floating window to the developer’s screen.
  • Give a window an exact logical frame without leaving the dock: the frame is pinned on the window’s root visual element, which every product window lays out and measures from, while the tab keeps whatever size the layout gives it. A frame larger than the tab is simply clipped by the tab on screen; layout, picking, and capture read the full frame.
  • Capture the pinned root offscreen (RenderRoot): the root’s own tree is rendered by a detached Editor panel at the frame size while preserving its native focused element, so capture never requires OS-window focus or display pixels, and no window is ever floated, maximized, or resized for it.
  • Float a window only when there is no main window to dock into, which is batch mode, where nothing is on screen.
  • Track every window it opened and close all of them on demand, before an assembly reload (a shown window that survives one comes back as a “Failed to load” tab), and whenever a run ends.
  • Close orphaned containers: a dock area whose every pane is gone, which is what a destroyed-but-never-closed window leaves on screen.

Does NOT:

  • Change how a product window opens for a customer, persist layout preferences, or run anything on Editor load by itself; the sweeps run only when automation calls them.

Anchor(EditorWindow window, float frameWidth, float frameHeight)

Section titled “Anchor(EditorWindow window, float frameWidth, float frameHeight)”
C#
public static void Anchor(UnityEditor.EditorWindow window, float frameWidth, float frameHeight)

Source declaration: ../bitquirky-graph/Editor/GraphView/Automation/AutomatedEditorWindowHost.cs:125-137

Pins an already open window to an exact logical frame and takes it under this host’s sweep. A docked window stays docked at whatever size its tab has; a floating one (batch mode) is sized to the frame inside the main window’s bounds.

C#
public static void Close(UnityEditor.EditorWindow window)

Source declaration: ../bitquirky-graph/Editor/GraphView/Automation/AutomatedEditorWindowHost.cs:345-363

Closes one window through Unity’s own close, which removes its tab from the dock area (an inactive tab has no panel but very much has a dock area; destroying it directly would leave that area pointing at a dead pane). A window that was never shown has no host and is destroyed directly; one whose object is already gone is forgotten, and the container it may have left behind is closed byCloseAll.

C#
public static int CloseAll()

Source declaration: ../bitquirky-graph/Editor/GraphView/Automation/AutomatedEditorWindowHost.cs:369-384

Closes every window this host opened that is still alive, then every orphaned container. Returns how many windows and containers were closed.

C#
public static int CloseOrphanedContainers()

Source declaration: ../bitquirky-graph/Editor/GraphView/Automation/AutomatedEditorWindowHost.cs:390-441

Closes every floating container whose dock areas hold no live window: the tabs Unity titles “Failed to load”. The main window is never touched. Returns the count closed.

C#
public static UnityEngine.Vector2 ContentOrigin(UnityEditor.EditorWindow window)

Source declaration: ../bitquirky-graph/Editor/GraphView/Automation/AutomatedEditorWindowHost.cs:144-152

Where the window’s root begins inside its panel: below the tab strip. An element’s world bound maps into a capture of the root (RenderRoot) by subtracting it.

Dock(EditorWindow window, float fallbackWidth, float fallbackHeight)

Section titled “Dock(EditorWindow window, float fallbackWidth, float fallbackHeight)”
C#
public static void Dock(UnityEditor.EditorWindow window, float fallbackWidth = 800, float fallbackHeight = 600)

Source declaration: ../bitquirky-graph/Editor/GraphView/Automation/AutomatedEditorWindowHost.cs:101-118

Docks an existing window beside the Scene view: one a fixture built detached and presents in only some of its tests, or one a product path has already shown in its own floating container (a picker dialog), which is moved into the main window before it ever paints and its emptied container closed. Without a dock target (batch mode) a detached window floats atfallbackWidthby fallbackHeight.

C#
public static T Dock<T>() where T : UnityEditor.EditorWindow

Source declaration: ../bitquirky-graph/Editor/GraphView/Automation/AutomatedEditorWindowHost.cs:69-79

Opens a newTdocked beside the Scene view, laid out at the size the tab gives it. For a surface that needs an exact frame use the sized overload.

Dock<T>(float frameWidth, float frameHeight)

Section titled “Dock<T>(float frameWidth, float frameHeight)”
C#
public static T Dock<T>(float frameWidth, float frameHeight) where T : UnityEditor.EditorWindow

Source declaration: ../bitquirky-graph/Editor/GraphView/Automation/AutomatedEditorWindowHost.cs:86-91

Opens a newTdocked beside the Scene view with its root pinned to exactlyframeWidth by frameHeightlogical pixels, the frame every measurement and capture reads.

C#
public static UnityEngine.Vector2 FrameOf(UnityEditor.EditorWindow window)

Source declaration: ../bitquirky-graph/Editor/GraphView/Automation/AutomatedEditorWindowHost.cs:158-168

The logical frame a window lays out in: the pinned frame, else the size its tab or floating container gives its root.

C#
public static UnityEngine.Texture2D RenderRoot(UnityEditor.EditorWindow window)

Source declaration: ../bitquirky-graph/Editor/GraphView/Automation/AutomatedEditorWindowHost.cs:184-332

Renders the window’s pinned root offscreen at one pixel per logical pixel: an RGBA32 texture of the root’s frame, rows bottom-up as every Unity texture read is, composited over the Editor’s window background exactly as the host paints beneath a transparent root. Children still owned by that root are moved into a detached Editor panel carrying the same default and product stylesheets, classes, and font, rendered, and surviving transferred children are moved back. The render target carries a stencil buffer, so rounded overflow clipping draws as it does on screen. Callers give the window real time to settle its layout first, as they would before reading a presented frame.

Resolve(Rect unityWindow, Rect unityDisplay, Vector2 requestedSize)

Section titled “Resolve(Rect unityWindow, Rect unityDisplay, Vector2 requestedSize)”
C#
public static UnityEngine.Rect Resolve(UnityEngine.Rect unityWindow, UnityEngine.Rect unityDisplay, UnityEngine.Vector2 requestedSize)

Source declaration: ../bitquirky-graph/Editor/GraphView/Automation/AutomatedEditorWindowHost.cs:452-465

Resolves the frame for a floating automated window (batch mode only): the requested size, shrunk only to the display, offset inside the main Unity window and clamped onto the display.

Category: Low-level runtime

C#
class BitQuirky.Graph.GraphView.Automation.EditorPanelCaptureState

Source declaration: ../bitquirky-graph/Editor/GraphView/Automation/EditorPanelCaptureState.cs:16-255

Preserves the user-owned UI Toolkit state while one visual tree is temporarily moved between Editor panels for offscreen rendering.

EditorPanelCaptureState(VisualElement sourceRoot)

Section titled “EditorPanelCaptureState(VisualElement sourceRoot)”
C#
public EditorPanelCaptureState(UnityEngine.UIElements.VisualElement sourceRoot)

Source declaration: ../bitquirky-graph/Editor/GraphView/Automation/EditorPanelCaptureState.cs:58-82

Snapshots focus, selectable text ranges, and scrolling below sourceRoot. A detached root has no focus to preserve.

C#
public void Restore(UnityEngine.UIElements.IPanel panel)

Source declaration: ../bitquirky-graph/Editor/GraphView/Automation/EditorPanelCaptureState.cs:114-165

Validates the destination layout without repainting native IMGUI, silently restores focus on that panel, then restores selectable text ranges and scrolling. Passing null restores the non-panel state of an originally detached tree.

C#
public void SuspendFocus()

Source declaration: ../bitquirky-graph/Editor/GraphView/Automation/EditorPanelCaptureState.cs:89-107

Silently removes the captured focus and selected-text owners from the panel that currently contains the migrated tree. Focus pseudo-states remain on the elements so capture paints the same styling, but removal cannot synthesize a user FocusOut event.

Source fingerprint: sha256:ad0983d00d773d882bc61865e18d8c5559e009d181e5891575cd7f262515b23e

Full-size image