SetIsResizable(bool)
Sets whether the window can be resized manually.
Read time 1 minuteLast updated 12 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Windowing
- Assembly: UnityEngine.WindowingModule
public AsyncOperation SetIsResizable(bool isResizable)
Parameters
True to allow the window to be resized manually, false to prevent it.
Returns
Type | Description |
|---|---|
| AsyncOperation | An AsyncOperation that represents the asynchronous operation. |
Remarks
This only controls manual resizing through the windowing system. You can always resize the window from a script with GameWindow.SetResolution. Use GameWindow.IsResizable to query the current value.
This method has no effect on QNX, where the platform doesn't support changing whether a window is resizable, or on a full-screen window on any platform. In both cases the returned operation still completes successfully, but the value that GameWindow.IsResizable reports doesn't change.
Examples
using UnityEngine;using UnityEngine.Windowing;public class SetWindowResizableExample : MonoBehaviour{ void Start() { var window = GameWindow.Main; var op = window.SetIsResizable(true); op.completed += (AsyncOperation o) => { // Triggers when the resizability change is complete Debug.Log($"Window resizability set to: {window.IsResizable()}"); }; }}