MaxAttribute.cs 722 B

12345678910111213141516171819202122232425
  1. using System;
  2. namespace UnityEngine.Rendering.PostProcessing
  3. {
  4. /// <summary>
  5. /// Use this attribute to clamp floating point values to a maximum value in the inspector.
  6. /// </summary>
  7. [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
  8. public sealed class MaxAttribute : Attribute
  9. {
  10. /// <summary>
  11. /// The maximum value the field will be clamped to.
  12. /// </summary>
  13. public readonly float max;
  14. /// <summary>
  15. /// Creates a new attribute.
  16. /// </summary>
  17. /// <param name="max">The maximum value the field will be clamped to</param>
  18. public MaxAttribute(float max)
  19. {
  20. this.max = max;
  21. }
  22. }
  23. }