Без опису
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

SamsungVariableRefreshRate.cs 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. namespace UnityEngine.AdaptivePerformance.Samsung.Android
  2. {
  3. /// <summary>
  4. /// Event handler declaration.
  5. /// </summary>
  6. public delegate void VariableRefreshRateEventHandler();
  7. /// <summary>
  8. /// Interface of the Samsung Variable Refresh Rate API.
  9. /// </summary>
  10. public interface IVariableRefreshRate
  11. {
  12. /// <summary>
  13. /// List of supported display refresh rates.
  14. /// </summary>
  15. int[] SupportedRefreshRates { get; }
  16. /// <summary>
  17. /// The current display refresh rate.
  18. /// </summary>
  19. int CurrentRefreshRate { get; }
  20. /// <summary>
  21. /// Change the current display refresh rate to the value referenced by the given index from the list of supported refresh rates.
  22. /// </summary>
  23. /// <param name="index"></param>
  24. /// <returns>True if the display refresh rate was updated successfully, false otherwise. Returns false if the requested refresh rate is larger than the `Application.targetFrameRate`. **Note:** There is a delay before the actual refresh rate and the value of `Screen.currentResolution.refreshRate` are updated.</returns>
  25. bool SetRefreshRateByIndex(int index);
  26. /// <summary>
  27. /// Event that is called if the current display refresh rate or the list of supported refresh rate is changed externally, for example by changing display settings.
  28. /// </summary>
  29. event VariableRefreshRateEventHandler RefreshRateChanged;
  30. }
  31. /// <summary>
  32. /// Holds the global instance to the Variable Refresh Rate API.
  33. /// </summary>
  34. public static class VariableRefreshRate
  35. {
  36. /// <summary>
  37. /// Global instance to access the variable refresh API.
  38. /// Can be null if variable refresh rate is not supported.
  39. /// </summary>
  40. static public IVariableRefreshRate Instance { get; set; }
  41. }
  42. }