Search Results for

    Show / Hide Table of Contents

    Class Automation

    A collection of helper methods used for automation processes.

    Inheritance
    System.Object
    Automation
    Namespace: GDX.Editor
    Syntax
    public static class Automation

    Methods

    | Improve this Doc View Source

    CaptureAllWindows()

    Capture a UnityEngine.Texture2D of all open UnityEditor.EditorWindow.

    Declaration
    public static Texture2D CaptureAllWindows()
    Returns
    Type Description
    UnityEngine.Texture2D

    The UnityEngine.Texture2D captured.

    | Improve this Doc View Source

    CaptureAllWindowsToPNG(String)

    Captures a PNG image of all open UnityEditor.EditorWindow.

    Declaration
    public static bool CaptureAllWindowsToPNG(string outputPath)
    Parameters
    Type Name Description
    System.String outputPath

    The absolute path for the image file.

    Returns
    Type Description
    System.Boolean

    true/false if the capture was successful.

    | Improve this Doc View Source

    CaptureEditorWindow(EditorWindow)

    Capture a UnityEngine.Texture2D of the editor window.

    Declaration
    public static Texture2D CaptureEditorWindow(EditorWindow window)
    Parameters
    Type Name Description
    UnityEditor.EditorWindow window
    Returns
    Type Description
    UnityEngine.Texture2D

    The UnityEngine.Texture2D captured.

    | Improve this Doc View Source

    CaptureEditorWindow<T>(Boolean)

    Capture a UnityEngine.Texture2D of the designated UnityEditor.EditorWindow.

    Declaration
    public static Texture2D CaptureEditorWindow<T>(bool shouldCloseWindow = true)
        where T : EditorWindow
    Parameters
    Type Name Description
    System.Boolean shouldCloseWindow
    Returns
    Type Description
    UnityEngine.Texture2D

    The UnityEngine.Texture2D captured.

    Type Parameters
    Name Description
    T

    The type of UnityEditor.EditorWindow to be captured.

    | Improve this Doc View Source

    CaptureEditorWindowToPNG(EditorWindow, String)

    Capture a PNG image of the provided window.

    Declaration
    public static bool CaptureEditorWindowToPNG(EditorWindow window, string outputPath)
    Parameters
    Type Name Description
    UnityEditor.EditorWindow window

    The target window.

    System.String outputPath

    The absolute path for the image file.

    Returns
    Type Description
    System.Boolean

    true/false if the capture was successful.

    | Improve this Doc View Source

    CaptureEditorWindowToPNG<T>(String, Boolean)

    Capture a PNG image of the designated UnityEditor.EditorWindow.

    Declaration
    public static bool CaptureEditorWindowToPNG<T>(string outputPath, bool shouldCloseWindow = true)
        where T : EditorWindow
    Parameters
    Type Name Description
    System.String outputPath

    The absolute path for the image file.

    System.Boolean shouldCloseWindow

    Should the gotten window be closed after the capture?

    Returns
    Type Description
    System.Boolean

    true/false if the capture was successful.

    Type Parameters
    Name Description
    T

    The type of UnityEditor.EditorWindow to be captured.

    | Improve this Doc View Source

    CaptureFocusedEditorWindow()

    Capture a UnityEngine.Texture2D of the focused editor window.

    Declaration
    public static Texture2D CaptureFocusedEditorWindow()
    Returns
    Type Description
    UnityEngine.Texture2D

    The UnityEngine.Texture2D captured.

    | Improve this Doc View Source

    CaptureFocusedEditorWindowToPNG(String)

    Capture a PNG image of the currently focused window.

    Declaration
    public static bool CaptureFocusedEditorWindowToPNG(string outputPath)
    Parameters
    Type Name Description
    System.String outputPath

    The absolute path for the image file.

    Returns
    Type Description
    System.Boolean

    true/false if the capture was successful.

    | Improve this Doc View Source

    ClearTempFolder(Boolean)

    Clear the automation temporary folder.

    Declaration
    public static void ClearTempFolder(bool deleteFolder = false)
    Parameters
    Type Name Description
    System.Boolean deleteFolder

    Should the automation folder be deleted?

    | Improve this Doc View Source

    FinishProfile()

    Stop an existing profile, this is most often used to end a command line profile of the Editor startup.

    Declaration
    public static void FinishProfile()
    Remarks

    The editor needs to be started with profiling arguments; more info can be found on https://docs.unity3d.com/Manual/EditorCommandLineArguments.html.

    ArgumentDescription
    -profiler-enableEnable profile at start.
    -profiler-log-file [path/to/file.raw]The absolute path to where the profiling data should be stored.
    -profiler-maxusedmemory [bytesize]The maximum amount of memory for the profiler to use.
    -deepprofilingShould a deep profile be done?
    -executeMethod GDX.Editor.Automation.FinishProfileExecutes this method to stop the profiling.
    | Improve this Doc View Source

    GenerateProjectFiles()

    Generate the project's solution and associated project files.

    Declaration
    public static void GenerateProjectFiles()
    | Improve this Doc View Source

    GetEditorBounds()

    Accumulate the screen space bounds of all editor windows.

    Declaration
    public static Bounds GetEditorBounds()
    Returns
    Type Description
    UnityEngine.Bounds

    The accumulated bounds.

    | Improve this Doc View Source

    GetGameView()

    Returns a reference to the first available GameView.

    Declaration
    public static EditorWindow GetGameView()
    Returns
    Type Description
    UnityEditor.EditorWindow

    An reference to an instance of the GameView

    | Improve this Doc View Source

    GetWindow<T>(EditorWindowExtensions.EditorWindowSetup)

    Declaration
    public static T GetWindow<T>(EditorWindowExtensions.EditorWindowSetup setup)
        where T : EditorWindow
    Parameters
    Type Name Description
    EditorWindowExtensions.EditorWindowSetup setup
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    GetWindow<T>(Boolean, Int32, Int32)

    Get the existing or open a new window with the indicated size / flags.

    Declaration
    public static T GetWindow<T>(bool shouldMaximize = false, int width = 800, int height = 600)
        where T : EditorWindow
    Parameters
    Type Name Description
    System.Boolean shouldMaximize

    Should the window be maximized?

    System.Int32 width

    The desired window pixel width.

    System.Int32 height

    The desired window pixel height.

    Returns
    Type Description
    T

    The instantiated window, or null.

    Type Parameters
    Name Description
    T

    The type of the window requested.

    Remarks

    Maintains old behaviour.

    | Improve this Doc View Source

    ResetEditor()

    Reset the editor to a default state.

    Declaration
    public static void ResetEditor()
    Remarks

    Using this method inside of a unit test will break the runner/chain.

    | Improve this Doc View Source

    RestoreWindowLayout()

    Declaration
    public static void RestoreWindowLayout()
    | Improve this Doc View Source

    StashWindowLayout()

    Declaration
    public static void StashWindowLayout()
    • Improve this Doc
    • View Source
    In This Article
    Back to top Built on 2024-01-01 against 1f69a68.
    Generated by Dox+DocFX.