using UnityEngine;
using System.Collections;
public class Fpsshow : MonoBehaviour {
public float f_UpdateInterval = 0.5F;
private float f_LastInterval;
private int i_Frames = 0;
private float f_Fps;
void Start()
{
f_LastInterval = Time.realtimeSinceStartup;
i_Frames = 0;
}
void OnGUI()
{
// GUI.Label(new Rect(0, 100, 800, 800), "FPS:" + f_Fps.ToString("f2"));
GUI.Label(new Rect(0, 100, 800, 800), "i_Frames:" + i_Frames);
}
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;
//}
}
}