GradientUsageAttribute
Controls how the Gradient inspector editor treats the color values.
Read time 4 minutesLast updated 4 days ago
Definition
- Type: Class
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
- Inherits from: PropertyAttribute
- Implements: _Attribute
[AttributeUsage(AttributeTargets.Field, Inherited = true, AllowMultiple = false)]public sealed class GradientUsageAttribute : PropertyAttribute, _Attribute
Remarks
Use this attribute on a Gradient public script variable. You can control the GradientUsageAttribute.colorSpace and GradientUsageAttribute.hdr flags.
Examples
using UnityEngine;public class ExampleScript : MonoBehaviour{ // Inspector editor for this gradient // allows to setup regular low dynamic range // colors. public Gradient defaultGradient; // Inspector editor for this gradient allows // to setup HDR colors. [GradientUsage(true)] public Gradient hdrGradient;}
Fields
Value | Description |
|---|---|
| colorSpace | The color space the Gradient uses. |
| hdr | If set to true the Gradient uses HDR colors. |
Constructors
Constructor | Description |
|---|---|
| GradientUsageAttribute(System.Boolean) | Attribute for gradient fields. Used to configure the GUI for the Gradient Editor. |
| GradientUsageAttribute(System.Boolean,UnityEngine.ColorSpace) | Attribute for gradient fields. Used to configure the GUI for the Gradient Editor. |