Custom Data 模块

您所在的位置:网站首页 unity如何添加脚本 Custom Data 模块

Custom Data 模块

#Custom Data 模块| 来源: 网络整理| 查看: 265

Unity User Manual 2022.3 (LTS) 图形 Visual effects 粒子系统 内置粒子系统 组件和模块 粒子系统模块 Custom Data 模块 Trails 模块 Renderer 模块 Custom Data 模块

Custom Data 模块允许您在 Editor 中定义要附加到粒子的自定义数据格式。您也可以在脚本中进行此设置。有关如何在脚本中设置自定义数据并将该数据发送到着色器的更多信息,请参阅粒子系统顶点流的相关文档。

数据可以是__矢量 (Vector)__ 的形式,包含最多 4 个 MinMaxCurve 组件或__颜色 (Color)__,此颜色是支持 HDR 的 MinMaxGradient。使用此数据可在脚本和着色器中驱动自定义逻辑。

可自定义每个曲线/渐变的默认标签,只需单击它们并输入上下文名称即可。将自定义数据传递给着色器时,了解如何在着色器中使用该数据非常有用。例如,曲线可用于自定义的 Alpha 测试,或者可使用渐变向粒子添加辅助颜色。通过编辑标签,很容易在 UI 中保留每个自定义数据条目的记录。

Using the Custom Data module

This module is part of the Particle System component. When you create a new Particle System GameObject, or add a Particle System component to an exiting GameObject, Unity adds the Custom Data module to the Particle System. By default, Unity disables this module. To create a new Particle System and enable this module:

Click GameObject > Effects > Particle System. In the Inspector, find the Particle System component. In the Particle System component, find the Custom Data module fold-out. To the left of the fold-out header, enable the checkbox. API

Since this module is part of the Particle System component, you access it through the ParticleSystem class. For information on how to access it and change values at runtime, see the Custom Data module API documentation.

2017–09–04 页面已修订 在 Unity 2017.2 中添加了可编辑的自定义数据标签 NewIn20172 Trails 模块 Renderer 模块


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3