Aucune description
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

SamsungAndroidProviderSettings.cs 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using UnityEngine;
  2. using UnityEngine.AdaptivePerformance;
  3. namespace UnityEngine.AdaptivePerformance.Samsung.Android
  4. {
  5. /// <summary>
  6. /// Provider Settings for Samsung Android provider, which controls the runtime asset instance that stores the settings.
  7. /// </summary>
  8. [System.Serializable]
  9. [AdaptivePerformanceConfigurationData("Samsung (Android)", SamsungAndroidProviderConstants.k_SettingsKey)]
  10. public class SamsungAndroidProviderSettings : IAdaptivePerformanceSettings
  11. {
  12. [SerializeField, Tooltip("Enable Logging in Devmode")]
  13. bool m_SamsungProviderLogging = false;
  14. /// <summary>
  15. /// Control debug logging of the Samsung provider.
  16. /// This setting only affects development builds. All logging is disabled in release builds.
  17. /// You can also control the global logging setting after startup by using <see cref="IDevelopmentSettings.Logging"/>.
  18. /// Logging is disabled by default.
  19. /// </summary>
  20. /// <value>Set this to true to enable debug logging, or false to disable it (default: false).</value>
  21. public bool samsungProviderLogging
  22. {
  23. get { return m_SamsungProviderLogging; }
  24. set { m_SamsungProviderLogging = value; }
  25. }
  26. [SerializeField, Tooltip("Allow High-Speed Variable Refresh Rate. It is required if you want to use variable refresh rates higher than 60hz. Can increase device temperature when activated.")]
  27. bool m_HighSpeedVRR = false;
  28. /// <summary>
  29. /// Use High-Speed Variable Refresh Rate to allow refresh rates higher than 60 fps set via VRR APIs.
  30. /// This is required if you want to use variable refresh rates higher than 60hz.
  31. /// Can increase device temperature when activated.
  32. /// This setting only has an effect if a device supports Variable Refresh Rate.
  33. /// Unity does not set High-Speed Variable Refresh Rate automatically by default.
  34. /// </summary>
  35. /// <value>Set this to true to allow High-Speed Variable Refresh Rate, or false to disable it (default: false).</value>
  36. public bool highSpeedVRR
  37. {
  38. get { return m_HighSpeedVRR; }
  39. set { m_HighSpeedVRR = value; }
  40. }
  41. [SerializeField, Tooltip("Enable Automatic Variable Refresh Rate. Only enabled if VRR is supported on the target device.")]
  42. bool m_AutomaticVRR = true;
  43. /// <summary>
  44. /// Use automatic Variable Refresh Rate to set refresh rate automatically based on the timing of CPU, GPU, device thermal state, and target framerate.
  45. /// This setting only affects the refresh rate if the device supports Variable Refresh Rate.
  46. /// Unity sets Variable Refresh Rate automatically by default.
  47. /// </summary>
  48. /// <value>`Set this to true to enable Automatic Variable Refresh Rate, false to disable it (default: true if device supports Variable Refresh Rate).</value>
  49. public bool automaticVRR
  50. {
  51. get { return m_AutomaticVRR; }
  52. set { m_AutomaticVRR = value; }
  53. }
  54. /// <summary>Static instance that holds the runtime asset instance Unity creates during the build process.</summary>
  55. #if !UNITY_EDITOR
  56. public static SamsungAndroidProviderSettings s_RuntimeInstance = null;
  57. #endif
  58. void Awake()
  59. {
  60. #if !UNITY_EDITOR
  61. s_RuntimeInstance = this;
  62. #endif
  63. }
  64. /// <summary>
  65. /// Returns Android Provider Settings which are used by Adaptive Performance to apply Provider Settings.
  66. /// </summary>
  67. /// <returns>Android Provider Settings</returns>
  68. public static SamsungAndroidProviderSettings GetSettings()
  69. {
  70. SamsungAndroidProviderSettings settings = null;
  71. #if UNITY_EDITOR
  72. UnityEditor.EditorBuildSettings.TryGetConfigObject<SamsungAndroidProviderSettings>(SamsungAndroidProviderConstants.k_SettingsKey, out settings);
  73. #else
  74. settings = s_RuntimeInstance;
  75. #endif
  76. return settings;
  77. }
  78. }
  79. }