Version: Unity 6.3 Beta (6000.3)
LanguageEnglish
  • C#

GameWindow.Main

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

public static Windowing.GameWindow Main;

Returns

GameWindow The main GameWindow instance.

Description

Gets the main window of the application.

Returns the main window without allocating memory on repeated calls. This property is not thread-safe; use only from the main thread.

using UnityEngine;
using UnityEngine.Windowing;

public class MainWindowExample : MonoBehaviour { void Start() { GameWindow mainWindow = GameWindow.Main; Debug.Log(mainWindow != null ? "Main window acquired." : "No main window."); } }