mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/MI-38.git
synced 2026-01-24 02:25:38 +03:00
19 lines
349 B
C#
19 lines
349 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class FPS : MonoBehaviour
|
|
{
|
|
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;
|
|
}
|
|
GUILayout.Label("FPS = " + oldFPS);
|
|
}
|
|
}
|