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

GameWindowManager.Create

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

Declaration

public static CreateWindowAsyncOperation Create(ref GameWindowCreationSettings settings);

Parameters

Parameter Description
settings The settings to use for creating the window.

Returns

CreateWindowAsyncOperation A CreateWindowAsyncOperation that represents the asynchronous window creation operation. Use the operation to get the created GameWindow once the operation completes.

Description

Creates a new window asynchronously with the specified settings.

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