Version: 2023.1

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 应采用的绘制顺序。

对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961