Unity3D基础教程2-6:粒子系统(Particle Systems)

2014-08-08 18:29:40|?次阅读|上传:huigezrx【已有?条评论】发表评论

关键词:Unity3D, 游戏, 虚拟现实|来源:唯设编程网

Animating Color 动画颜色

If you would like your particles to change colors or fade in/out, enable them to Animate Color and specify the colors for the cycle. Any particle system that animates color will cycle through the 5 colors you choose. The speed at which they cycle will be determined by the Emitter's Energy value.

若你希望你的粒子更改颜色或渐显/淡出,启用它们的Animate Color 并指定颜色的循环周期。任何的粒子系统使用你所选择的5种颜色进行动画颜色的循环。它们的循环速度由发射器的Energy值决定。

If you want your particles to fade in rather than instantly appear, set your first or last color to have a low Alpha value.


Unity3D基础教程2-4:粒子系统(Particle Systems)
An Animating Color Particle System 一个动画颜色粒子系统

Rotation Axes 旋转轴(坐标)

Setting values in either the Local or World Rotation Axes will cause all spawned particles to rotate around the indicated axis (with the Transform's position as the center). The greater the value is entered on one of these axes, the faster the rotation will be.


Setting values in the Local Axes will cause the rotating particles to adjust their rotation as the Transform's rotation changes, to match its local axes.


Setting values in the World Axes will cause the particles' rotation to be consistent, regardless of the Transform's rotation.


Forces & Damping 强制与衰减

You use force to make particles accelerate in the direction specified by the force.


Damping can be used to decelerate or accelerate without changing their direction:


  • A value of 1 means no Damping is applied, the particles will not slow down or accelerate.
  • 值为1表示无衰减使用,这些粒子将不会减慢或加速
  • A value of 0 means particles will stop immediately.
  • 设为0表示粒子将立即停止
  • A value of 2 means particles will double their speed every second.
  • 设为2表示粒子将在每秒钟获得两倍的速度

Destroying GameObjects attached to Particles


You can destroy the Particle System and any attached GameObject by enabling the AutoDestruct property. For example, if you have an oil drum, you can attach a Particle System that has Emit disabled and AutoDestruct enabled. On collision, you enable the Particle Emitter. The explosion will occur and after it is over, the Particle System and the oil drum will be destroyed and removed from the scene.  


。Note that automatic destruction takes effect only after some particles have been emitted. The precise rules for when the object is destroyed when AutoDestruct is on:

注意当一些粒子发射后自动销毁的效果就生效。这个精确规则为:当AutoDestruct 开启,物体就销毁

If there have been some particles emitted already, but all of them are dead now, or

If the emitter did have Emit on at some point, but now Emit is off.


Hints 提示

  • Use the Color Animation to make your particles fade in & out over their lifetime - otherwise, you will get nasty-looking pops.
  • 使用颜色动画让你的粒子进行渐显和对它们的生命周期处理,否则,你将持久性的污染投影
  • Use the Rotation Axes to make whirlpool-like swirly motions.
  • 使用旋转坐标去处理旋窝般的动作。

Particle Collider 粒子碰撞

The World Particle Collider is used to collide particles against other Colliders in the scene.


Unity3D基础教程2-4:粒子系统(Particle Systems)
A Particle System colliding with a Mesh Collider  一个粒子系统碰撞的网格碰撞

Properties 属性

Bounce Factor


Particles can be accelerated or slowed down when they collide against other objects. This factor is similar to the Particle Animator's Damping property.

当它们与其它物体碰撞时,这些粒子可以加速或放慢速度。这一因素与 Particle Animator's Damping 属性相似

Collision Energy Loss


Amount of energy (in seconds) a particle should lose when colliding. If the energy goes below 0, the particle is killed.


Min Kill Velocity


If a particle's Velocity drops below Min Kill Velocity because of a collision, it will be eliminated.


Collides with


Which Layers the particle will collide against.


Send Collision Message


If enabled, every particle sends out a collision message that you can catch through scripting.


Details 详细资料

To create a Particle System with Particle Collider:


  1. Create a Particle System using GameObject->Create Other->Particle System

建立一个粒子系统,使用菜单 游戏物体—>建立其它 —>粒子系统

  1. Add the Particle Collider using Component->Particles->World Particle Collider

添加碰撞粒子,使用菜单 组件—>粒子 —>全局粒子碰撞

发表评论0条 】
Unity3D基础教程2-6:粒子系统(Particle Systems)