Unity3D显示帧率以及设置不限制帧率
2014-07-01 14:55
537 查看
using UnityEngine; using System.Collections; public class Fps : MonoBehaviour { float updateInterval = 0.5f; private float accum = 0.0f; private float frames = 0; private float timeleft; // Use this for initialization void Start() { if (!guiText) { enabled = false; return; } timeleft = updateInterval; } // Update is called once per frame void Update() { timeleft -= Time.deltaTime; accum += Time.timeScale / Time.deltaTime; ++frames; if (timeleft <= 0.0) { guiText.text = "" + (accum / frames).ToString("f2"); timeleft = updateInterval; accum = 0.0f; frames = 0; } } }
相关文章推荐
- Unity3D显示帧率以及设置不限制帧率
- Unity3d 帧率设置 及在游戏运行时显示帧率
- Unity3d帧率设置及在游戏运行时显示帧率
- Unity3d 帧率设置 及在游戏执行时显示帧率
- Unity3d 帧率设置 及在游戏运行时显示帧率
- Unity3d 中显示 Spine 动画节点 以及设置 帧事件
- Unity3D显示帧率以及设置垂直同步
- 设置chart饼图中显示的线,以及显示百分比
- jquery下 动态显示jqGrid 以及jqGrid的属性设置容易出现的问题
- Moss/Sharepoint 为特定用户组设置特定视图以及可见视图,自定义列表新建页,修改页和显示页(无代码法)
- Vim的行号、语法显示等设置(.vimrc文件的配置)以及乱码解决
- VIM C和C++编程环境设置(高亮显示以及自动缩进) [转]
- SPS安装过程中配置服务器场帐户设置页面不能正常显示以及IIS中SPS管理站点未配置成功问题的原因
- [httpd.conf]apache限制IP的并发数以及限制带宽的设置
- 通过窗口大小适时调整以及子窗口的动态布局来解决窗口在不同DPI设置下的显示问题
- Qt窗口屏幕居中显示以及设置大小
- VIM C和C++编程环境设置(高亮显示以及自动缩进) [转]
- jquery下动态显示jqGrid以及jqGrid的属性设置容易出现问题的解决方法
- 将<div><ul><li>中的数据设置为无编号,横向显示并且居中显示在下方的样式,以及在打开新的页面。
- Vim的行号、语法显示等设置(.vimrc文件的配置)以及乱码解决