使用此模块可将轨迹添加到一部分粒子。此模块与轨迹渲染器 (Trail Renderer) 组件共享许多属性,但提供了将轨迹轻松附加到粒子以及从粒子继承各种属性的功能。轨迹可用于各种效果,例如子弹、烟雾和魔法视觉效果。
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 Trails module to the Particle System. By default, Unity disables this module. To create a new Particle System and enable this module:
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 Trails module API documentation.
For some properties in this section, you can use different modes to set their value. For information on the modes you can use, see Varying properties over time.
属性: | 功能: | |||
---|---|---|---|---|
Mode | 选择如何为粒子系统生成轨迹。 - Particle 模式可创建每个粒子在自身路径中留下固定轨迹的效果。 - Ribbon 模式可创建根据存活时间连接每个粒子的轨迹带。 |
|||
Ratio | 一个介于 0 和 1 之间的值,表示已分配轨迹的粒子的比例。Unity 随机分配轨迹,因此该值表示概率。 | |||
Lifetime | 轨迹中每个顶点的生命周期,表示为所属粒子的生命周期的乘数。当每个新顶点添加到轨迹时,该顶点将在其存在时间超过其总生命周期后消失。 | |||
Minimum Vertex Distance | 定义粒子在其轨迹接收新顶点之前必须经过的距离。 | |||
World Space | 启用此属性后,即便使用 Local Simulation Space__,轨迹顶点也不会相对于粒子系统的游戏对象移动。相反,轨迹顶点将被置于世界空间中,并忽略粒子系统的任何移动。 |
| Die With Particles| 如果选中此框,轨迹会在粒子死亡时立即消失。如果未选中此框,则剩余的轨迹将根据自身的剩余生命周期自然到期。 |
| Ribbon Count| 选择要在整个粒子系统中渲染的轨迹带数量。值为 1 将创建连接每个粒子的单个轨迹带。但是,大于 1 的值将创建连接每第 N 个粒子的轨迹带。例如,使用值 2 时,将有一条轨迹带连接粒子 1、3、5,另一条轨迹带连接粒子 2、4、6,以此类推。粒子的排序取决于它们的存活时间。 |
| Split Sub Emitter Ribbons| 在用作子发射器的系统上启用此属性时,从同一父系统粒子生成的粒子将共享一个轨迹带。 |
| Texture Mode| Choose how textures are applied to Particle Trails. - Stretch__ mode stretches the texture along the entire length of the trail. - Tile repeats the texture every N units of distance. The repeat rate is controlled based on the Tiling parameters in the Material. - Repeat per Segment mode repeats the texture along the trail, repeating at a rate of once per trail segment. The repeat rate is controlled based on the Tiling parameters in the Material. - Distribute per Segment mode maps the texture once along the entire length of the trail, and assumes that all vertices are evenly spaced. |
|||
Size affects Width | 如果启用此属性(选中复选框),则轨迹宽度受粒子大小影响。 | |||
Size affects Lifetime | 如果启用此属性(选中复选框),则轨迹生命周期受粒子大小影响。 | |||
Inherit Particle Color | 如果启用此属性(选中复选框),则轨迹颜色由粒子颜色调制。 | |||
Color over Lifetime | 通过一条曲线控制整个轨迹在其附着粒子的整个生命周期内的颜色。 | |||
Width over Trail | 通过一条曲线控制轨迹沿其长度的宽度。 | |||
Color over Trail | 通过一条曲线控制轨迹沿其长度的颜色。 | |||
Generate Lighting Data | 通过启用此属性(选中复选框),可在构建轨迹几何体时包含法线和切线。这样允许它们使用具有场景光照的材质,例如通过标准着色器,或通过使用自定义着色器。 | |||
Shadow Bias | Move the shadows along the direction of the light. This removes shadowing artifacts caused by approximating volumes with billboarded trail geometry. |
2017–10–26 页面已修订
在 Unity 2017.1 中添加了 Size affects Width、Size affects Lifetime、Color over Lifetime、Width over Trail、Color over Trail 和 Generate Lighting Data NewIn20171
在 Unity 2017.3 中添加了 Particle 模式 NewIn20173
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.