XRSupportedBuildTargetAttribute.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. #if UNITY_EDITOR
  3. using UnityEditor;
  4. namespace UnityEditor.XR.Management
  5. {
  6. [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
  7. public sealed class XRSupportedBuildTargetAttribute : Attribute
  8. {
  9. /// <summary>
  10. /// String representation of <see href="https://docs.unity3d.com/ScriptReference/BuildTargetGroup.html">UnityEditor.Build.BuildTargetGroup
  11. /// </summary>
  12. public BuildTargetGroup buildTargetGroup { get; set; }
  13. /// <summary>
  14. /// Array of BuildTargets, each of which is the representation of <see href="https://docs.unity3d.com/ScriptReference/BuildTarget.html">UnityEditor.Build.BuildTarget
  15. /// aligned with <see cref="buildTargetGroup"/>.
  16. ///
  17. /// Currently only advisory.
  18. /// </summary>
  19. public BuildTarget[] buildTargets { get; set; }
  20. private XRSupportedBuildTargetAttribute() { }
  21. /// <summary>Constructor for attribute. We assume that all build targets for this group will be supported.</summary>
  22. /// <param name="buildTargetGroup">Build Target Group that will be supported.</param>
  23. public XRSupportedBuildTargetAttribute(BuildTargetGroup buildTargetGroup)
  24. {
  25. this.buildTargetGroup = buildTargetGroup;
  26. }
  27. /// <summary>Constructor for attribute</summary>
  28. /// <param name="buildTargetGroup">Build Target Group that will be supported.</param>
  29. /// <param name="buildTargets">The set of build targets of Build Target Group that will be supported.</param>
  30. public XRSupportedBuildTargetAttribute(BuildTargetGroup buildTargetGroup, BuildTarget[] buildTargets)
  31. {
  32. this.buildTargetGroup = buildTargetGroup;
  33. this.buildTargets = buildTargets;
  34. }
  35. }
  36. }
  37. #endif