22 lines
444 B
C#
22 lines
444 B
C#
using System.Globalization;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace FastArena
|
|
{
|
|
public class FpsCounter : MonoBehaviour
|
|
{
|
|
private Text txt;
|
|
|
|
private void Start()
|
|
{
|
|
txt = GetComponent<Text>();
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
float fps = 1f / Time.deltaTime;
|
|
txt.text = fps.ToString(CultureInfo.InvariantCulture);
|
|
}
|
|
}
|
|
} |