Screen.fullScreen 全屏

static var fullScreen : bool

Description描述

Is the game running fullscreen?

游戏是否运行在全屏模式?

It is possible to toggle fullscreen mode by changing this property:

改变这个属性,可以开关全屏模式:

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		Screen.fullScreen = !Screen.fullScreen;
	}
}
// Toggle fullscreen
//切换全屏

Screen.fullScreen = !Screen.fullScreen;

A fullscreen switch does not happen immediately; it will actually happen when the current frame is finished.

全屏开关不会立即发生,它实际发生是在当前帧完成时。

参考:SetResolution.

最后修改:2011年1月17日 Monday 23:18

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。