Version: Unity 6.6 Alpha (6000.6)
LanguageEnglish
  • C#

CreateWindowAsyncOperation

class in UnityEngine.Windowing

/

Inherits from:AsyncOperation

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

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.

Additional resources: AsyncOperation, GameWindowManager.Create.

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()}"); }; } }

Properties

Property Description
windowReturns the created GameWindow after the asynchronous operation completes.

Inherited Members

Properties

PropertyDescription
allowSceneActivationAllow Scenes to be activated as soon as it is ready.
isDoneHas the operation finished? (Read Only)
priorityPriority lets you tweak in which order async operation calls will be performed.
progressWhat's the operation's progress. (Read Only)

Events

EventDescription
completedRaised when this AsyncOperation operation has completed.