Application.targetFrameRate 目标帧速率

static var targetFrameRate : int

Description描述

Instructs game to try to render at a specified frame rate.

命令游戏尝试以一个特定的帧率渲染。

Setting targetFrameRate to -1 (the default) makes standalone games render as fast as they can, and web player games to render at 50-60 frames/second depending on the platform.

设置targetFrameRate为-1(默认)使独立版游戏尽可能快的渲染,并且web播放器游戏以50-60帧/秒渲染,取决于平台。

Note that setting targetFrameRate does not guarantee that frame rate. There can be fluctuations due to platform specifics, or the game might not achieve the frame rate because the computer is too slow.

注意设置targetFrameRate不会保证帧率,会因为平台的不同而波动,或者因为计算机太慢而不能取得这个帧率。

targetFrameRate is ignored in the editor.

在编辑器中targetFrameRate被忽略。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void Awake() {
		Application.targetFrameRate = 300;
	}
}
function Awake () {
	// Make the game run as fast as possible in the web player
	//使游戏尽可能快的运行,在web播放器里
	Application.targetFrameRate = 300;
}
最后修改:2010年12月15日 Wednesday 0:35

本脚本参考基于Unity 3.4.1f5

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