GetWindows(List<GameWindow>)
Populates the provided list with all currently active windows in the application.
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Method
- Namespace: UnityEngine.Windowing
- Assembly: UnityEngine.WindowingGatedModule
public static void GetWindows(List<GameWindow> windows)
Parameters
A List to be populated with GameWindow objects representing all available windows.
Examples
using System.Collections.Generic;using UnityEngine;using UnityEngine.Windowing;public class GetWindowsExample : MonoBehaviour{ List<GameWindow> windows = new List<GameWindow>(); void Start() { GameWindowManager.GetWindows(windows); Debug.Log($"Total windows: {windows.Count}"); foreach (var window in windows) { Debug.Log($"Window: {window.GetTitle()}, Size: {window.GetWidth()}x{window.GetHeight()}"); } }}