纳金网

标题: unity3d中固定帧速的设置 [打印本页]

作者: 会飞的鱼    时间: 2011-12-28 17:27
标题: unity3d中固定帧速的设置
今天在翻官方的帮助手册,发现原来unity3d程序也可以设置默认的运行帧频,就像在flash中的帧频功能一样,只不过在unity3d中并不能百分百的让程序按固定帧频来运行,毕竟这牵涉到一个硬件性能的问题。下面看看用到是是哪一个类及相关属性:
Application.targetFrameRate  
static var targetFrameRate : int

Description

Ins***cts 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.
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 is ignored in the editor.
function Awake ()

{

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

Application.targetFrameRate = 300;

}
由 uke  发表


作者: ly    时间: 2011-12-30 18:51

作者: C.R.CAN    时间: 2012-3-9 23:27
很经典,很实用,学习了!

作者: C.R.CAN    时间: 2012-3-25 23:28
不错哦,顶一下......

作者: 晃晃    时间: 2012-5-5 23:27
爱咋咋地!

作者: 晃晃    时间: 2012-9-22 23:35
凡系斑竹滴话要听;凡系朋友滴帖要顶!

作者: 菜刀吻电线    时间: 2012-10-4 23:25
跑着去顶朋友滴铁

作者: tc    时间: 2013-3-21 23:29
发了那么多,我都不知道该用哪个给你回帖了,呵呵

作者: heise    时间: 2013-4-15 14:27
以前iOS还只能在XCODE里面设置!!现在好多了!




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