mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/MI-38.git
synced 2026-01-24 05:35:38 +03:00
04.07.2022
This commit is contained in:
20
Heli_with_panels/Assets/Scripts/FPS.cs.private.0
Normal file
20
Heli_with_panels/Assets/Scripts/FPS.cs.private.0
Normal file
@@ -0,0 +1,20 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user