XRConfigurationData.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. namespace UnityEngine.XR.Management
  6. {
  7. /// <summary>
  8. /// This attribute is used to tag classes as providing build settings support for an XR provider. The unified setting system
  9. /// will present the settings as an inspectable object in the Unified Settings window using the built-in inspector UI.
  10. ///
  11. /// The implementor of the settings is able to create their own custom UI and the Unified Settings system will use that UI in
  12. /// place of the build in inspector. See the &lt;a href="https://docs.unity3d.com/Manual/ExtendingTheEditor.html">&gt;Extending the Editor&lt;/a&gt;
  13. /// portion of the Unity documentation for information and instructions on doing this.
  14. /// </summary>
  15. [AttributeUsage(AttributeTargets.Class)]
  16. public sealed class XRConfigurationDataAttribute : Attribute
  17. {
  18. /// <summary>
  19. /// The display name to be presented to the user in the Unified Settings window.
  20. /// </summary>
  21. public string displayName { get; set; }
  22. /// <summary>
  23. /// The key that will be used to store the singleton instance of these settings within EditorBuildSettings.
  24. ///
  25. /// See &lt;a href="https://docs.unity3d.com/ScriptReference/EditorBuildSettings.html"&gt;EditorBuildSettings&lt;/a&gt; scripting
  26. /// API documentation on how this is beign done.
  27. /// </summary>
  28. public string buildSettingsKey { get; set; }
  29. private XRConfigurationDataAttribute() {}
  30. /// <summary>Constructor for attribute</summary>
  31. /// <param name="displayName">The display name to use in the Project Settings window.</param>
  32. /// <param name="buildSettingsKey">The key to use to get/set build settings with.</param>
  33. public XRConfigurationDataAttribute(string displayName, string buildSettingsKey)
  34. {
  35. this.displayName = displayName;
  36. this.buildSettingsKey = buildSettingsKey;
  37. }
  38. }
  39. }