| Parameter | Description |
|---|---|
| isVisible | True to show the window, false to hide it. |
AsyncOperation An AsyncOperation that represents the asynchronous operation.
Sets whether the window is visible.
Hiding a window doesn't destroy it or release its resources. The window keeps its title, position, and resolution, and you can show it again later. Use GameWindow.IsVisible to query the current value.
Note that if you hide every window, the operating system might suspend the application and it stops running its update loop. Scripts can't show a window again while the application is suspended, so keep at least one window visible if you rely on script execution to restore the others.
using UnityEngine; using UnityEngine.Windowing;
public class SetWindowVisibleExample : MonoBehaviour { void Start() { var window = GameWindow.Main; var op = window.SetIsVisible(false);
op.completed += (AsyncOperation o) => { // Triggers when the visibility change is complete Debug.Log($"Window visibility set to: {window.IsVisible()}"); }; } }