13 lines
266 B
C#
13 lines
266 B
C#
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class FPSCounter : MonoBehaviour
|
|
{
|
|
[SerializeField] private TextMeshProUGUI fpsText;
|
|
|
|
void Update()
|
|
{
|
|
float fps = 1f / Time.unscaledDeltaTime;
|
|
fpsText.text = "FPS: " + Mathf.RoundToInt(fps);
|
|
}
|
|
} |