No Description
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.

GameModeFPS.cs 847B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Collections;
  2. using UnityEngine;
  3. using UnityEngine.AdaptivePerformance;
  4. public class GameModeFPS : MonoBehaviour
  5. {
  6. public SampleFactory objectFactory;
  7. IAdaptivePerformance m_AP;
  8. void Start()
  9. {
  10. m_AP = Holder.Instance;
  11. if (m_AP == null)
  12. {
  13. Debug.Log("[Performance Mode Control] Warning Adaptive Performance Manager was not found and does not report");
  14. return;
  15. }
  16. // to ensure that we can reach max possible fps
  17. objectFactory.LimitCount = 64;
  18. StartCoroutine(TestTimeout());
  19. }
  20. IEnumerator TestTimeout()
  21. {
  22. while (true)
  23. {
  24. yield return new WaitForSeconds(300);
  25. #if UNITY_EDITOR
  26. UnityEditor.EditorApplication.isPlaying = false;
  27. #else
  28. Application.Quit();
  29. #endif
  30. }
  31. }
  32. }