2022-12-05 18:29:49 +08:00

33 lines
904 B
C#

using UnityEngine;
using UnityEngine.UI;
namespace Assets.Scenes.Ride.Scripts
{
public class FpsController : MonoBehaviour
{
public float showTime = 1f;
public Text tvFpsInfo;
private int count = 0;
private float deltaTime = 0f;
// Update is called once per frame
private void Awake()
{
tvFpsInfo = GetComponent<Text>();
}
private void Update()
{
//count++;
//deltaTime += Time.deltaTime;
//if (deltaTime >= showTime)
//{
// float fps = count / deltaTime;
// //float milliSecond = deltaTime * 1000 / count;
// string strFpsInfo = string.Format("{0:0.}FPS", fps);
// tvFpsInfo.text = strFpsInfo;
// count = 0;
// deltaTime = 0f;
//}
}
}
}