Unity3D显示帧率以及设置不限制帧率
2015-05-07 12:55
405 查看
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 中显示 Spine 动画节点 以及设置 帧事件
- Unity3d 帧率设置 及在游戏运行时显示帧率
- Unity3d帧率设置及在游戏运行时显示帧率
- MAC_限制Excel显示的行数/列数_Excel的ScrollArea设置
- DWORD数据类型和ZeroMemory函数解释以及IDE黑色背景设置和相同源代码高亮显示
- 自定义Dialog,去除系统默认黑色背景以及边框并设置dialog的显示位置
- jqGrid动态隐藏列显示列以及设置显示相对宽度
- Unity3d-WWW实现图片资源显示以及保存和本地加载
- UITextField(限制文字输入,调整光标,内容,占位文字显示的位置,以及基本使用)
- 设置文字QT按钮包含图片与文字,以及鼠标停留备注显示,和sheetstyle风格设置。
- dos命令之 set (显示、设置或删除 cmd.exe 环境变量) 用法详解以及使用变量
- 设置android的屏幕显示[横屏、竖屏/以及全屏]
- iOS设置UITableView的背景图片,以及不显示多余的空Cell
- linux: bash登录的显示信息设置以及环境配置文件.
- EditText属性设置以及输入长度限制
- Unity3D集成Android插件,会出现在Unity3D中设置图标,却显示Android中的图标问题