Class EditorWindowCapture
Capture the current scene view into a Texture2D for use in ImageAssert tests.
Inherited Members
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. |