纳金网

标题: unity3d 固定帧速的设置( 频率 速率 帧率 ) [打印本页]

作者: yeu1233    时间: 2012-8-29 10:22
标题: unity3d 固定帧速的设置( 频率 速率 帧率 )
unity3d 固定帧速的设置
Application.targetFrameRate

static var targetFrameRate : int

以固定帧率运行游戏:
值设定为-1时,windows***将以最大速率运行,而生成网页文件将以50-60帧/秒的帧率运行程序。



当然,此时设定的值并不一定是程序运行时的帧率。这是因为平台的不同,还有可能是计算机速度达不到设定值。
该值在编辑器中运行时被忽略。


以前我做游戏时发布成品Exe后只有在屏幕的分辨率下才能够流畅的运行,其他分辨率总是很卡。。设定targetFrameRate 后分辨率就不影响游戏速度了


function Awake ()

{

// Make the game***n as fast as possible in the web player

Application.targetFrameRate = 300;

}







欢迎光临 纳金网 (http://go.narkii.com/club/) Powered by Discuz! X2.5