Ei kuvausta
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.

IAdaptivePerformance.cs 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. namespace UnityEngine.AdaptivePerformance
  2. {
  3. /// <summary>
  4. /// Constants used by Adaptive Performance.
  5. /// </summary>
  6. public static class Constants
  7. {
  8. /// <summary>
  9. /// The minimum temperature level.
  10. /// See <see cref="ThermalMetrics.TemperatureLevel"/>.
  11. /// </summary>
  12. /// <value>0.0</value>
  13. public const float MinTemperatureLevel = 0.0f;
  14. /// <summary>
  15. /// The maximum temperature level.
  16. /// See <see cref="ThermalMetrics.TemperatureLevel"/>.
  17. /// </summary>
  18. /// <value>1.0</value>
  19. public const float MaxTemperatureLevel = 1.0f;
  20. /// <summary>
  21. /// The minimum CPU level.
  22. /// Used by <see cref="IDevicePerformanceControl.CpuLevel"/> and <see cref="PerformanceMetrics.CurrentCpuLevel"/>.
  23. /// </summary>
  24. /// <value>0</value>
  25. public const int MinCpuPerformanceLevel = 0;
  26. /// <summary>
  27. /// The minimum GPU level.
  28. /// Used by <see cref="IDevicePerformanceControl.GpuLevel"/> and <see cref="PerformanceMetrics.CurrentGpuLevel"/>.
  29. /// </summary>
  30. /// <value>0</value>
  31. public const int MinGpuPerformanceLevel = 0;
  32. /// <summary>
  33. /// UnknownPerformanceLevel is the value of <see cref="IDevicePerformanceControl.GpuLevel"/>, <see cref="PerformanceMetrics.CurrentGpuLevel"/>,
  34. /// <see cref="IDevicePerformanceControl.CpuLevel"/>, and <see cref="PerformanceMetrics.CurrentCpuLevel"/> if the current performance level is unknown.
  35. /// This can happen when AdaptivePerformance is not supported or when the device is in throttling state (see <see cref="WarningLevel.Throttling"/>).
  36. /// </summary>
  37. /// <value>-1</value>
  38. public const int UnknownPerformanceLevel = -1;
  39. /// <summary>
  40. /// The number of past frames that are considered to calculate average frame times.
  41. /// </summary>
  42. /// <value>100</value>
  43. public const int DefaultAverageFrameCount = 100;
  44. }
  45. /// <summary>
  46. /// The main interface to access Adaptive Performance.
  47. /// None of the properties in this interface change after startup.
  48. /// This means the references returned by the properties may be cached by the user.
  49. /// </summary>
  50. public interface IAdaptivePerformance
  51. {
  52. /// <summary>
  53. /// Returns true if Adaptive Performance was initialized successfully, false otherwise.
  54. /// This means that Adaptive Performance is enabled in StartupSettings and the application runs on a device that supports Adaptive Performance.
  55. /// </summary>
  56. /// <value>True when Adaptive Performance is available, false otherwise.</value>
  57. bool Active { get; }
  58. /// <summary>
  59. /// Access thermal status information of the device.
  60. /// </summary>
  61. /// <value>Interface to access thermal status information of the device.</value>
  62. IThermalStatus ThermalStatus { get; }
  63. /// <summary>
  64. /// Access performance status information of the device and your application.
  65. /// </summary>
  66. /// <value>Interface to access performance status information of the device and your application.</value>
  67. IPerformanceStatus PerformanceStatus { get; }
  68. /// <summary>
  69. /// Control CPU and GPU performance of the device.
  70. /// </summary>
  71. /// <value>Interface to control CPU and GPU performance levels of the device.</value>
  72. IDevicePerformanceControl DevicePerformanceControl { get; }
  73. /// <summary>
  74. /// Access to development (logging) settings.
  75. /// </summary>
  76. /// <value>Interface to control CPU and GPU performance levels of the device.</value>
  77. IDevelopmentSettings DevelopmentSettings { get; }
  78. /// <summary>
  79. /// Access to the Indexer system. See <see cref="AdaptivePerformanceIndexer"/>
  80. /// </summary>
  81. /// <value>Interface to scalers that are active and their associated settings.</value>
  82. AdaptivePerformanceIndexer Indexer { get; }
  83. /// <summary>
  84. /// Access to the Settings. See <see cref="IAdaptivePerformanceSettings"/>.
  85. /// </summary>
  86. /// <value>Interface to settings that are loaded from the provider settings object during startup.</value>
  87. IAdaptivePerformanceSettings Settings { get; }
  88. /// <summary>
  89. /// List of supported Features by the loaded provider. See <see cref="Provider.Feature"/>.
  90. /// </summary>
  91. /// <param name="feature">The feature in question. See <see cref="Provider.Feature"/>.</param>
  92. /// <returns>True if the requested feature is supported, false otherwise.</returns>
  93. bool SupportedFeature(Provider.Feature feature);
  94. }
  95. /// <summary>
  96. /// Global access to the default AdaptivePerformance interface.
  97. /// </summary>
  98. public static class Holder
  99. {
  100. /// <summary>
  101. /// Global access to the default AdaptivePerformance interface to access the main manager object.
  102. /// </summary>
  103. static public IAdaptivePerformance Instance { get; internal set; }
  104. }
  105. }