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.

InputSettingsiOS.cs 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #if UNITY_EDITOR || UNITY_IOS || UNITY_TVOS || PACKAGE_DOCS_GENERATION
  2. using System;
  3. using UnityEngine.InputSystem.iOS;
  4. namespace UnityEngine.InputSystem.iOS
  5. {
  6. /// <summary>
  7. /// Governs access to a privacy-related resource on the user's device. Corresponds to a key in the application's
  8. /// Information Property List (Info.plist).
  9. /// </summary>
  10. /// <seealso href="https://developer.apple.com/documentation/bundleresources/information_property_list/protected_resources"/>
  11. [Serializable]
  12. public class PrivacyDataUsage
  13. {
  14. /// <summary>
  15. /// Whether access to the respective resource will be requested.
  16. /// </summary>
  17. /// <remarks>
  18. /// Before accessing a resource or a sensor, you need to explicitly enable the usage for it, otherwise the access for the resource will be denied.
  19. ///
  20. /// If this is set to true, the respective protected resource key will be entered in the application's Information Property List (Info.plist)
  21. /// using <see cref="usageDescription"/>.
  22. /// </remarks>
  23. public bool enabled
  24. {
  25. get => m_Enabled;
  26. set => m_Enabled = value;
  27. }
  28. /// <summary>
  29. /// Provide meaningful usage description.
  30. /// </summary>
  31. /// <remarks>
  32. /// The description will be presented to the user in the dialog when you'll try to access a related resource or sensor.
  33. /// </remarks>
  34. public string usageDescription
  35. {
  36. get => m_Description;
  37. set => m_Description = value;
  38. }
  39. [SerializeField] private bool m_Enabled;
  40. [SerializeField] private string m_Description;
  41. }
  42. }
  43. namespace UnityEngine.InputSystem
  44. {
  45. public partial class InputSettings
  46. {
  47. /// <summary>
  48. /// Project-wide input settings for the iOS/tvOS platform.
  49. /// </summary>
  50. [Serializable]
  51. public class iOSSettings
  52. {
  53. /// <summary>
  54. /// Setting for access to the device's motion sensors (such as <see cref="StepCounter"/>).
  55. /// </summary>
  56. /// <remarks>
  57. /// Alternatively, you can manually add <c>Privacy - Motion Usage Description</c> to the Info.plist file.
  58. /// </remarks>
  59. /// <seealso cref="StepCounter"/>
  60. /// <seealso href="https://developer.apple.com/documentation/bundleresources/information_property_list/nsmotionusagedescription"/>
  61. public PrivacyDataUsage motionUsage
  62. {
  63. get => m_MotionUsage;
  64. set => m_MotionUsage = value;
  65. }
  66. [SerializeField] private PrivacyDataUsage m_MotionUsage = new PrivacyDataUsage();
  67. }
  68. /// <summary>
  69. /// iOS/tvOS-specific settings.
  70. /// </summary>
  71. /// <remarks>
  72. /// This is only accessible in the editor or in iOS/tvOS players.
  73. /// </remarks>
  74. public iOSSettings iOS => m_iOSSettings;
  75. [SerializeField]
  76. private iOSSettings m_iOSSettings = new iOSSettings();
  77. }
  78. }
  79. #endif