unity 显示帧率
来源:互联网 发布:巨炮舰队扫矿软件 编辑:程序博客网 时间:2024/06/05 01:15
可参考Unity圣典点击打开链接
public class FPS: MonoBehaviour{ public static float f_Fps; public float f_UpdateInterval = 0.5f; //每个0.5秒刷新一次 private float f_LastInterval; //游戏时间 private int i_Frames = 0;//帧数 void Awake() { Application.targetFrameRate = 60; } void OnGUI() { if (f_Fps > 50) { GUI.color = new Color(0, 1, 0); } else if (f_Fps > 40) { GUI.color = new Color(1, 1, 0); } else { GUI.color = new Color(1.0f, 0, 0); } GUI.Box(new Rect(10, 10, 100, 30), "FPS:" + f_Fps.ToString("f2")); } void Update() { ++i_Frames; if (Time.realtimeSinceStartup > f_LastInterval + f_UpdateInterval) { f_Fps = i_Frames / (Time.realtimeSinceStartup - f_LastInterval); i_Frames = 0; f_LastInterval = Time.realtimeSinceStartup; } }}
就是如此简单...
0 0
- unity 显示帧率
- Unity 显示帧率的方法
- Unity 帧率设置和显示FPS脚本
- Unity基础包 工具类 FPSCounter脚本显示帧率
- Unity中的中文显示
- Unity IOS 中文显示
- unity ios中文字体显示
- Unity 中文显示
- Unity GUI 中文显示
- Unity如何显示中文
- Android显示Unity视图
- 005.unity显示UI
- unity显示FPS
- Unity 显示FPS
- unity中多屏显示
- Unity 显示FPS
- unity之切换显示
- unity ugui多边形显示
- hdu 5437 Alisha’s Party
- Java常用类练习3
- 【leetcode】Roman to Integer【java】
- 想考个数据库工程师证要做哪些
- 关于iOS和OS X废弃的API你需要知道的一切
- unity 显示帧率
- windows下 MySQL的表名大小写 移植到Linux 区分大小写
- cocos2d-x 3.2 物理小游戏教程2 block it 物理世界 墙壁
- 文章标题
- php使用php include之后页首有空白
- 【收集】cocos2dx中加载使用plist文件
- hdoj1104,Remainder
- 例题3.17 生命的形式 UVa11107
- 杭州电子科技大学acm--2017