Unity 显示FPS
来源:互联网 发布:易知资本 编辑:程序博客网 时间:2024/05/16 19:41
using System.Collections;using System.Collections.Generic;using UnityEngine;public class FPS : MonoBehaviour { float lastFPSTime; int curFrameCount; string curFPS = ""; void Start () { } void OnGUI() { OnShowFPS(); } void OnShowFPS() { if (lastFPSTime == 0) { lastFPSTime = Time.time; curFrameCount = Time.frameCount; curFPS = ""; } else { float curTime = Time.time; if (curTime >= lastFPSTime + 1.0f) { int n = Time.frameCount - curFrameCount; float dt = curTime - lastFPSTime; curFPS = string.Format("FPS:{0:.00}", n / dt); lastFPSTime = curTime; curFrameCount = Time.frameCount; } GUI.skin.label.fontSize = 28; GUI.contentColor = Color.white; GUI.Label(new Rect(480, 10, 200, 100), curFPS); } }}
阅读全文
0 0
- unity显示FPS
- Unity 显示FPS
- Unity 显示FPS
- unity中FPS的设置与显示
- 【Unity】查看与显示游戏帧数FPS
- Unity中显示实时FPS值
- Unity 3D 代码显示 FPS
- Unity 帧率设置和显示FPS脚本
- Unity 实时显示FPS——移动端测试神器
- unity中FPS计算
- unity lua实现fps
- Unity统计FPS脚本
- unity中获取FPS
- unity实时显示fps脚本、设置分辨率脚本、设置shader的最大lod
- opencv 显示摄像头+fps
- UFPS入门: Unity FPS 教程
- Unity FPS帧率计算
- ogre中显示FPS框
- 面试时,如何向公司提问?
- C语言之变量的存储方式和生存周期
- PAT1075 链表元素分类
- vSphere共享存储全配置流程
- 软件构造 课堂笔记5
- Unity 显示FPS
- java知识
- Hadoop MapReduce 简单案例--求平均值
- 计算机二级易混点
- 表格布局注册页面
- android 关机流程详细分析
- Unsupported major.minor version 51.0
- 高德地图开发Key的申请
- 习题6-1 平衡的括号(Parentheses Balance, UVa 673)