class in UnityEngine.Windowing
/
Inherits from:AsyncOperation
/
Implemented in:UnityEngine.CoreModule
Asynchronous operation object returned from GameWindowManager.Create. This class extends AsyncOperation.
You can yield until it continues, register an event handler with CreateWindowAsyncOperation.completed, or manually check whether it's done (CreateWindowAsyncOperation.isDone) or progress (CreateWindowAsyncOperation.progress).
The CreateWindowAsyncOperation class encapsulates the asynchronous window creation process. Once the operation is complete (isDone is true), you can access the created window through the window property.
using System.Collections.Generic; using UnityEngine; using UnityEngine.Windowing;
public class CreateWindowExample : MonoBehaviour { List<DisplayInfo> displayInfos = new List<DisplayInfo>(); void Start() { DisplayInfo.GetLayout(displayInfos); var settings = new GameWindowCreationSettings( title: "Second Window", width: 600, height: 400, position: new Vector2Int(0, 0), cameraDisplayIndex: 1, displayInfo: displayInfos[0], fullScreenMode: FullScreenMode.Windowed, resizable: false ); var op = GameWindowManager.Create(settings); op.completed += (AsyncOperation o) => { Debug.Log($"Window Created: {op.window.GetTitle()}"); }; } }
| window | Returns the created GameWindow after the asynchronous operation completes.This property provides access to the newly created window. You can only access this property after the operation completes (when AsyncOperation.isDone is true). Accessing this property before the operation completes will throw an InvalidOperationException. Read-only. |
| allowSceneActivation | Allow Scenes to be activated as soon as it is ready. |
| isDone | Has the operation finished? (Read Only) |
| priority | Priority lets you tweak in which order async operation calls will be performed. |
| progress | What's the operation's progress. (Read Only) |
| completed | Event that is invoked upon operation completion. An event handler that is registered in the same frame as the call that creates it will be invoked next frame, even if the operation is able to complete synchronously. If a handler is registered after the operation has completed and has already invoked the complete event, the handler will be called synchronously. |