Application.runInBackground 后台运行
应用程序在后台时是否应该被运行?默认为假(当程序在后台时暂停)
// 让游戏在后台时也运行
Application.runInBackground = true;
Application.streamedBytes 字节流.
我们从主Unity网页流中下载了多少字节(只读)。在web播放器中这将返回到目前为止已经下载的压缩字节数。在独立模式或编辑器中总是返回零。
// Prints to a GUIText how many bytes we have streamed.
//输出到一个节界面文本,显示加载了多少字节流
function Update() {
guiText.text = "Streamed Bytes: " + Application.streamedBytes.ToString();
}
Application.systemLanguage 系统语言
你可以使用这个自动调选一个本地的,为你的基于用户的系统语言的内容。
//系统使用的实际语言打印到界面文本
guiText.text = Application.systemLanguage.ToString();
Application.targetFrameRate 目标帧速率
命令游戏尝试以一个特定的帧率渲染。
设置targetFrameRate为-1(默认)使独立版游戏尽可能快的渲染,并且web播放器游戏以50-60帧/秒渲染,取决于平台。
注意设置targetFrameRate不会保证帧率,会因为平台的不同而波动,或者因为计算机太慢而不能取得这个帧率。在编辑器中targetFrameRate被忽略。
function Awake () {
// Make the game run as fast as possible in the web player
//使游戏尽可能快的运行,在web播放器里
Application.targetFrameRate = 300;
}
应用程序在后台时是否应该被运行?默认为假(当程序在后台时暂停)
// 让游戏在后台时也运行
Application.runInBackground = true;
Application.streamedBytes 字节流.
我们从主Unity网页流中下载了多少字节(只读)。在web播放器中这将返回到目前为止已经下载的压缩字节数。在独立模式或编辑器中总是返回零。
// Prints to a GUIText how many bytes we have streamed.
//输出到一个节界面文本,显示加载了多少字节流
function Update() {
guiText.text = "Streamed Bytes: " + Application.streamedBytes.ToString();
}
Application.systemLanguage 系统语言
你可以使用这个自动调选一个本地的,为你的基于用户的系统语言的内容。
//系统使用的实际语言打印到界面文本
guiText.text = Application.systemLanguage.ToString();
Application.targetFrameRate 目标帧速率
命令游戏尝试以一个特定的帧率渲染。
设置targetFrameRate为-1(默认)使独立版游戏尽可能快的渲染,并且web播放器游戏以50-60帧/秒渲染,取决于平台。
注意设置targetFrameRate不会保证帧率,会因为平台的不同而波动,或者因为计算机太慢而不能取得这个帧率。在编辑器中targetFrameRate被忽略。
function Awake () {
// Make the game run as fast as possible in the web player
//使游戏尽可能快的运行,在web播放器里
Application.targetFrameRate = 300;
}