Version: 2022.2

GradientUsageAttribute

class in UnityEngine

/

继承自:PropertyAttribute

切换到手册

描述

Controls how the Gradient inspector editor treats the color values.

Use this attribute on a Gradient public script variable. You can control the colorSpace and hdr flags.

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; }

变量

colorSpaceThe color space the Gradient uses.
hdr如果设置为 true,则渐变使用 HDR 颜色。

构造函数

GradientUsageAttributeAttribute for gradient fields. Used to configure the GUI for the Gradient Editor.

继承的成员

变量

order可选字段,用于指定多个 DecorationDrawer 应采用的绘制顺序。