文档

Unity Engine

Unity Engine

IsResizable()

Checks if the window can be resized manually.
阅读时间1 分钟最后更新于 1 个月前

Definition

public bool IsResizable()

Returns

Type

Description

boolTrue if the window can be resized manually, false otherwise.

Remarks

The initial value comes from the
resizable
setting in GameWindowCreationSettings. Use GameWindow.SetIsResizable to change it at runtime.
On QNX, and for a full-screen window on any platform, GameWindow.SetIsResizable has no effect, so this method keeps returning the value the window was created with.

Examples

using UnityEngine;using UnityEngine.Windowing;public class IsWindowResizableExample : MonoBehaviour{ void Start() { var window = GameWindow.Main; bool resizable = window.IsResizable(); Debug.Log($"Is window resizable: {resizable}"); }}