FPS
来源:互联网 发布:电脑软件全部打不开 编辑:程序博客网 时间:2024/04/26 10:34
using UnityEngine;
using System.Collections;
public class FPS : MonoBehaviour {
private float m_timer;
private int m_frameCounter;
public float m_updateInterval = 0.5f;
public float m_fps;
public System.Action<float> m_fpsUpdateCallback;
// Use this for initialization
void Start () {
m_timer = 0;
m_frameCounter = 0;
}
// Update is called once per frame
void Update () {
m_timer += Time.deltaTime;
m_frameCounter++;
if(m_timer > m_updateInterval)
{
m_fps = m_frameCounter / m_timer;
m_frameCounter = 0;
m_timer = 0;
if (m_fpsUpdateCallback != null)
{
m_fpsUpdateCallback(m_fps);
}
}
}
}
using System.Collections;
public class FPS : MonoBehaviour {
private float m_timer;
private int m_frameCounter;
public float m_updateInterval = 0.5f;
public float m_fps;
public System.Action<float> m_fpsUpdateCallback;
// Use this for initialization
void Start () {
m_timer = 0;
m_frameCounter = 0;
}
// Update is called once per frame
void Update () {
m_timer += Time.deltaTime;
m_frameCounter++;
if(m_timer > m_updateInterval)
{
m_fps = m_frameCounter / m_timer;
m_frameCounter = 0;
m_timer = 0;
if (m_fpsUpdateCallback != null)
{
m_fpsUpdateCallback(m_fps);
}
}
}
}
0 0
- FPS
- FPS
- FPS
- FPS
- FPS
- fps
- FPS
- FPS
- FPS counter
- 精确FPS
- FPS 是什么意思
- FPS游戏
- FPS Constructor
- 精确FPS
- FPS优化
- FPS含义
- 名词解释---fps
- FPS相机
- 关联target在ant配置文件中的应用
- Android向上推送式菜单,两个视图在同一布局内同屏显示。
- 使用Rwordseg进行分词
- spirng3.0 3
- javaEE jdbc批处理
- FPS
- 论坛功能实现大概思路及URL锚点HTML定位技术机制、应用与问题
- zoj 3778 Talented Chef 模拟
- 通用树的实现
- ZigZag Conversion
- tarjan算法
- 黑马程序员___基本数据类型,标识符
- 调用人人网API
- A* find