文档

Unity Engine

Unity Engine

SetTitle(string)

Sets the title of the window.
阅读时间1 分钟最后更新于 1 个月前

Definition

public AsyncOperation SetTitle(string title)

Parameters

title

The new title for the window.

Returns

Type

Description

AsyncOperationAn AsyncOperation that represents the asynchronous operation.

Examples

using UnityEngine;using UnityEngine.Windowing;public class SetWindowTitleExample : MonoBehaviour{ AsyncOperation asyncOperation = null; void Start() { var window = GameWindow.Main; asyncOperation = window.SetTitle("My Game Window"); } void Update() { if (asyncOperation != null && asyncOperation.isDone) { Debug.Log("Window title set successfully."); asyncOperation = null; } }}