Something
public text v1 · immutableusing UnityEngine;
using System.Collections;
public class FPSdisplay : MonoBehaviour {
float updatePeriod = 0.5f;
float nextUpdate = 0.0f;
float frames = 0.0f;
float fps = 0.0f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
frames++;
if(Time.time > nextUpdate){
fps = Mathf.Round(frames / updatePeriod);
guiText.text = "Frames Per Second: " + fps;
nextUpdate = Time.time + updatePeriod;
frames = 0;
}
}
}