ドキュメント

Unity Engine

Unity Engine

GradientUsageAttribute

Controls how the Gradient inspector editor treats the color values.
読み終わるまでの所要時間 4 分最終更新 1ヶ月前

Definition

[AttributeUsage(AttributeTargets.Field, Inherited = true, AllowMultiple = false)]public sealed class GradientUsageAttribute : PropertyAttribute

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