Advertisement
Eonirr

Untitled

Dec 8th, 2022
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Fps : MonoBehaviour
  5. {
  6. private float count;
  7.  
  8. private IEnumerator Start()
  9. {
  10. GUI.depth = 2;
  11. while (true)
  12. {
  13. count = 1f / Time.unscaledDeltaTime;
  14. yield return new WaitForSeconds(0.1f);
  15. }
  16. }
  17.  
  18. private void OnGUI()
  19. {
  20. GUI.Label(new Rect(5, 40, 100, 25), "FPS: " + Mathf.Round(count));
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement