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.

VolumeRequiresRendererFeatures.cs 1.1KB

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Collections.Generic;
  3. namespace UnityEngine.Rendering.Universal
  4. {
  5. /// <summary>
  6. /// Use this attribute to show a warning next to a VolumeComponent's UI if the specified
  7. /// ScriptableRendererFeatures are not added to the active URP Asset's default renderer
  8. /// </summary>
  9. [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
  10. public sealed class VolumeRequiresRendererFeatures : Attribute
  11. {
  12. internal HashSet<Type> TargetFeatureTypes;
  13. /// <summary>
  14. /// Creates a new <see cref="VolumeRequiresRendererFeatures"/> attribute instance.
  15. /// </summary>
  16. /// <param name="featureTypes">The list of required ScriptableRendererFeature types. If any of these types are missing, the VolumeComponent UI shows a warning.</param>
  17. public VolumeRequiresRendererFeatures(params Type[] featureTypes)
  18. {
  19. TargetFeatureTypes = (featureTypes != null) ? new HashSet<Type>(featureTypes) : new HashSet<Type>();
  20. TargetFeatureTypes.Remove(null);
  21. }
  22. }
  23. }