You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
|
|
public class DebugInformation : MonoBehaviour
|
|
|
|
|
|
{
|
|
|
|
|
|
[SerializeField] Text fpsText;
|
|
|
|
|
|
float fps = 30.0f;
|
|
|
|
|
|
float stamp = -0.1f;
|
|
|
|
|
|
|
|
|
|
|
|
private void Start()
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void Update()
|
|
|
|
|
|
{
|
|
|
|
|
|
fps = Mathf.Lerp(fps, 1.0f / (Time.time - stamp), 0.02f);
|
|
|
|
|
|
stamp = Time.time;
|
|
|
|
|
|
fpsText.text = string.Format("fps: {0}", fps);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|