docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class EditorWindowPanelSimulator

    A PanelSimulator accessing an EditorWindow's panel. Allows for the simulation of time passing, sending events, and updating the panel in a synchronous manner.

    Inheritance
    object
    PanelSimulator
    EditorWindowPanelSimulator
    Inherited Members
    PanelSimulator.panel
    PanelSimulator.rootVisualElement
    PanelSimulator.currentTimeMs
    PanelSimulator.currentTime
    PanelSimulator.timePerSimulatedFrameMs
    PanelSimulator.timePerSimulatedFrame
    PanelSimulator.ResetTimePerSimulatedFrameToDefault()
    PanelSimulator.pixelsPerPoint
    PanelSimulator.panelName
    PanelSimulator.GetDefaultPanelSize()
    PanelSimulator.IncrementCurrentTimeMs(long)
    PanelSimulator.IncrementCurrentTime(double)
    PanelSimulator.ResetCurrentTime()
    PanelSimulator.needsRendering
    PanelSimulator.FrameUpdate()
    PanelSimulator.FrameUpdateMs(long)
    PanelSimulator.KeyPress(KeyCode, EventModifiers)
    PanelSimulator.ReturnKeyPress(EventModifiers)
    PanelSimulator.KeypadEnterKeyPress(EventModifiers)
    PanelSimulator.TabKeyPress(EventModifiers)
    PanelSimulator.TypingText(string, bool)
    PanelSimulator.KeyDown(KeyCode, EventModifiers)
    PanelSimulator.KeyUp(KeyCode, EventModifiers)
    PanelSimulator.Click(VisualElement, MouseButton, EventModifiers)
    PanelSimulator.Click(Vector2, MouseButton, EventModifiers)
    PanelSimulator.DoubleClick(VisualElement, MouseButton, EventModifiers)
    PanelSimulator.DoubleClick(Vector2, MouseButton, EventModifiers)
    PanelSimulator.DragAndDrop(Vector2, Vector2, MouseButton, EventModifiers)
    PanelSimulator.MouseDown(VisualElement, MouseButton, EventModifiers)
    PanelSimulator.MouseDown(Vector2, MouseButton, EventModifiers)
    PanelSimulator.MouseUp(VisualElement, MouseButton, EventModifiers)
    PanelSimulator.MouseUp(Vector2, MouseButton, EventModifiers)
    PanelSimulator.MouseMove(Vector2, Vector2, EventModifiers)
    PanelSimulator.MouseMove(Vector2, EventModifiers)
    PanelSimulator.ScrollWheel(Vector2, Vector2)
    PanelSimulator.ExecuteCommand(string)
    PanelSimulator.ValidateCommand(string)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.UIElements.TestFramework
    Assembly: Unity.UI.TestFramework.Editor.dll
    Syntax
    public sealed class EditorWindowPanelSimulator : PanelSimulator

    Constructors

    EditorWindowPanelSimulator(EditorWindow)

    Sets up the provided window for simulation.

    Declaration
    public EditorWindowPanelSimulator(EditorWindow window)
    Parameters
    Type Name Description
    EditorWindow window

    The EditorWindow to set up for simulation.

    Properties

    needsImprovedIMGUISupport

    Whether events are sent within an IMGUI context. Set this to true if the EditorWindow contains IMGUI content. Defaults to false.

    Declaration
    public bool needsImprovedIMGUISupport { get; set; }
    Property Value
    Type Description
    bool

    window

    EditorWindow tied to the panel.

    Declaration
    public EditorWindow window { get; }
    Property Value
    Type Description
    EditorWindow

    Methods

    ExecuteWithinIMGUIContext(Action)

    Invokes an Action after setting up the EditorWindow's IMGUI context. This ensures that the IMGUI state is properly setup when executing the provided command.

    Declaration
    public void ExecuteWithinIMGUIContext(Action command)
    Parameters
    Type Name Description
    Action command

    The Action to be executed.

    FrameUpdate(double)

    Performs a frame update of the panel.

    Declaration
    public override sealed void FrameUpdate(double time)
    Parameters
    Type Name Description
    double time

    The amount of time in seconds to increment the simulated time.

    Overrides
    PanelSimulator.FrameUpdate(double)
    Remarks

    This method simulates yielding a frame by the following:

    • Advances the panel's time by the specified time.
    • Updates the panel's scheduler and visual tree updaters.
    • If needsRendering is true, triggers rendering for the panel's ImmediateModeElement and invokes IMGUIContainer's OnGUI with a Repaint Event.
    • If needsImprovedIMGUISupport is true, the update is executed within an IMGUI context.
    See Also
    FrameUpdate()
    FrameUpdateMs(long)

    SetWindow(EditorWindow)

    Assigns the specified window to the EditorWindowPanelSimulator.

    Declaration
    public void SetWindow(EditorWindow window)
    Parameters
    Type Name Description
    EditorWindow window

    The EditorWindow instance to associate with the EditorWindowPanelSimulator.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)