docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class EditorWindowCapture

    Capture the current scene view into a Texture2D for use in ImageAssert tests.

    Inheritance
    object
    EditorWindowCapture
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.TestTools.Graphics
    Assembly: UnityEditor.TestTools.Graphics.dll
    Syntax
    public static class EditorWindowCapture

    Methods

    CaptureAsync(EditorWindow, EditorWindowCaptureSettings)

    Captures a scene view from the perspective of the chosen viewpoint transform.

    Declaration
    public static Awaitable<Texture2D> CaptureAsync(EditorWindow window, EditorWindowCaptureSettings settings)
    Parameters
    Type Name Description
    EditorWindow window

    An existing window that will be used for the capture.

    EditorWindowCaptureSettings settings

    Settings for the capture.

    Returns
    Type Description
    Awaitable<Texture2D>

    A Texture2D containing the captured scene view.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when the window is null.

    ArgumentOutOfRangeException

    Thrown when the width or height is less than or equal to zero.

    ArgumentOutOfRangeException

    Thrown when the wait time is negative.

    ArgumentNullException

    Thrown when no viewpoint transform was provided.

    In This Article
    Back to top
    Copyright © 2026 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)