Files
MI-38/Heli_with_panels/Assets/Scripts/FPS.cs.private.0
2022-07-04 13:15:35 +03:00

21 lines
440 B
Plaintext

using UnityEngine;
using System.Collections;
public class FPS : MonoBehaviour
{
private GUIStyle guiStyle = new GUIStyle();
int oldFPS=0;
int cnt = 0;
void OnGUI()
{
int fps = (int)(1.0f / Time.deltaTime);
if (fps != oldFPS) cnt++;
if(cnt > 40)
{
cnt = 0; oldFPS = fps;
}
guiStyle.fontSize = 22;
GUILayout.Label("FPS = " + oldFPS, guiStyle);
}
}