using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.UI; public class TMP_FpsText : Text { [SerializeField] public float updateInterval= 0.5f; float f =0; void Update(){ if(f < updateInterval){ f+=Time.deltaTime; }else{ f=0; text = (1f/Time.deltaTime).ToString("n1") + " FPS"; } } }