Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GradientUsageAttribute

Controls how the Gradient inspector editor treats the color values.
Read time 4 minutesLast updated 4 days ago

Definition

[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

colorSpaceThe color space the Gradient uses.
hdrIf 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.

Inheritance

Inherited Members