public Text frame_text = null;
int count = 0;
float timer = 0;
float interval = 1;
int frame = 0;
private void Update()
{
count++;
timer += Time.unscaledDeltaTime;
if (timer >= interval)
{
frame = (int)(count / timer);
frame_text.text = frame.ToString();
count = 0;
timer = 0;
}
}
Unity帧率
最新推荐文章于 2024-07-03 16:59:10 发布