FrameRateUtility.cs 489 B

1234567891011121314151617181920212223242526272829303132
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. public class FrameRateUtility : MonoBehaviour
  5. {
  6. #region Variable
  7. public static int FrameRate;
  8. private int Counter;
  9. private float Timer;
  10. #endregion
  11. public void Update()
  12. {
  13. Timer += Time.deltaTime;
  14. if (Timer >= 1)
  15. {
  16. Timer = 0;
  17. FrameRate = Counter;
  18. }
  19. else
  20. {
  21. Counter++;
  22. }
  23. }
  24. }