Version: 2022.3
Triggers 模块
Texture Sheet Animation 模块

Sub Emitters 模块

在此模块中可设置子发射器。这些子发射器是在粒子生命周期的某些阶段在粒子位置处创建的附加粒子发射器。

Using the Sub Emitters 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 Sub Emitters 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 Sub Emitters 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 Sub Emitters 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.

属性 功能
Sub Emitters 配置一个子发射器列表,并选择它们的触发条件以及它们从父粒子继承的属性。

详细信息

许多类型的粒子都会在其生命周期的不同阶段产生一些效果,而这也可使用粒子系统来实现。例如,子弹离开枪管时可能伴随着一缕烟尘,火球可能会在撞击时爆炸。您可以使用子发射器来创建诸如此类的效果。

子发射器是在场景中创建的或来自预制件的普通粒子系统对象。这意味着子发射器还可以有自己的子发射器(这种类型的布置对于像烟花这样的复杂效果很有用)。但是,虽然使用子发射器生成大量粒子非常容易,但这可能非常耗费资源。

要触发子发射器,可使用以下条件:

  • __Birth__:粒子的创建时间。
  • __Collision__:粒子与对象发生碰撞的时间。
  • __Death__:粒子的销毁时间。
  • __Trigger__:粒子与触发碰撞体相互作用的时间。
  • __Manual__:仅在通过脚本进行请求时触发。请参阅 ParticleSystem.TriggerSubEmitter

请注意,__CollisionTriggerDeath__ 和 Manual 事件只能使用 Emission 模块中的爆发发射。

此外,还可使用 Inherit 选项将属性从父粒子转移到每个新创建的粒子。可转移属性包括大小、旋转、颜色和生命周期。要控制速度的继承方式,请在子发射器系统上配置 Inherit Velocity 模块。

还可以通过设置 Emit Probability 属性来配置子发射器事件的触发概率。值为 1 可以保证事件将触发,而更小的值则会降低概率。

  • 2018–03–28 页面已修订

  • 2018.1 版中的 Sub Emitters 模块的条件列表中添加了“Trigger”和“Manual”条件 NewIn20181

  • 2018.3 版中向粒子 Sub Emitters 模块添加了 Emit Probability 属性 NewIn20183

Triggers 模块
Texture Sheet Animation 模块