Version: 2021.3
Color by Speed module
Size by Speed 模块

Size over Lifetime 模块

许多效果涉及根据曲线改变粒子大小,这些设置可在此模块中进行。

Using the Size over Lifetime 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 Size over Lifetime module to the Particle System. By default, Unity disables this module. To create a new Particle System and enable this module:

  1. Click GameObject > Effects > Particle System.
  2. In the Inspector, find the Particle System component.
  3. In the Particle System component, find the Size over Lifetime module fold-out.
  4. 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 Size over Lifetime 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.

属性 功能
Separate Axes 在每个轴上独立控制粒子大小。
Size 通过一条曲线定义粒子的大小在其生命周期内如何变化。

详细信息

一些粒子通常会在远离发射点时发生大小变化,比如表示气体、火焰或烟雾的粒子。例如,随着时间的推移,烟雾往往会消散并占据更大的体积。为实现此目的,可将烟雾粒子的曲线设置为向上坡道曲线,随着粒子的存活时间而增加。此外还可使用 Color Over Lifetime 模块在烟雾蔓延时淡化烟雾,从而进一步增强此效果。

对于燃料燃烧产生的火球,火焰粒子在发射后会趋于膨胀,但后期随着燃料用完和火焰消散而逐渐消失和收缩。在这种情况下,曲线会有一个先上升再下降到较小大小的“驼峰”。

The values specified in the curves are multiplied by the Start Size to get the final particle size.

非均匀粒子缩放

您可以指定粒子的宽度、高度和深度如何在生命周期内分别变化。在 Size over Lifetime 模块中,选中 Separate Axes 复选框,然后更改 X(宽度)、Y(高度)和 Z(深度)。请注意,Z 仅用于网格粒子。

Color by Speed module
Size by Speed 模块