Unity粒子系統


Unity Manual > User Guide > Building Scenes > Particle Systems

Particle Systems(粒子系統)

Particles are essentially 2D images rendered in 3D space. They are primarily used for effects such as smoke, fire, water droplets, or leaves. A Particle System is made up of three separate Components: Particle Emitter, Particle Animator, and a Particle Renderer. You can use a Particle Emitter and Renderer together if you want static particles. The Particle Animator will move particles in different directions and change colors. You also have access to each individual particle in a particle system via scripting, so you can create your own unique behaviors that way if you choose. 

Please view the Particle Scripting Reference here. 

The remainder of this page's text is from the Particle Component Reference pages. 

粒子基本上是在三維空間中渲染的二維圖像。它們主要用於諸如煙、火、水滴、或樹葉等效果。一個粒子系統是由三個獨立部分組成:粒子發射器、粒子動畫器、和粒子渲染器。如果你想要一個靜態粒子系統,你可以用一個粒子發射器和渲染器來完成。粒子動畫器將在不同的方向移動粒子和改變粒子的顏色。你還可以通過腳本使用粒子系統中的每一個粒子,因此你可以創建自己獨特的(粒子)行為,如果你選擇這樣。

請點擊這里查看粒子腳本參考。

本頁剩余的文字來自於Particle Component Reference。

Particle Components(粒子的組成)

Particle Systems(粒子系統)

Particle Systems in Unity are used to make clouds of smoke, steam, fire and other atmospheric effects. Particle Systems work by using one or two Textures & drawing them many times, creating a chaotic effect. 

粒子在Unity中是用來制造煙霧、蒸汽、火及其它大氣的效果。粒子系統通過使用一或兩個紋理並多次繪制它們,以創造一個混沌的效果。


A Particle System included in the Standard Assets一個粒子系統包含在標准資源包中

A typical Particle System in Unity is an object that contains a Particle Emitter, a Particle Animator and a Particle Renderer. The Particle Emitter generates the particles, the Particle Animator moves them over time, and the Particle Renderer draws them on the screen. 

If you want your particles to interact with the world, add a Particle Collider Component to the GameObject. 

Unity中一個典型的粒子系統是一個對象,它包含了一個粒子發射器、一個粒子動畫器和一個粒子渲染器。粒子發射器產生粒子,粒子動畫器則隨時間移動它們,粒子渲染器將它們繪制在屏幕上。

如果你想讓你的粒子對世界有影響,添加一個粒子碰撞器組件到游戲對象中。

Ellipsoid Particle Emitter(橢球粒子發射器)

The Ellipsoid Particle Emitter spawns particles inside a sphere. Use the Ellipsoid property below to scale & stretch the sphere. 

橢球粒子發射器在一個球形范圍內產生大量粒子,使用Ellipsoid屬性來縮放和拉伸范圍。


The Ellipsoid Particle Emitter Inspector橢球粒子發射器的檢視視圖

Properties(屬性)

 

 

Emit 發射

If enabled, the emitter will emit particles. 如果啟用,發射器將發射粒子

Min Size

最小尺寸

The minimum size each particle can be at the time when it is spawned. 在產生粒子時每個粒子可以達到的最小尺寸。

Max Size

最大尺寸

The maximum size each particle can be at the time when it is spawned. 在產生粒子時每個粒子可以達到的最大尺寸。

Min Energy

最小活力

The minimum lifetime of each particle, measured in seconds. 每個粒子的最短壽命,以秒為單位。

Max Energy

最大活力

The maximum lifetime of each particle, measured in seconds. 每個粒子的最長壽命,以秒為單位。

Min Emission

最小發射

The minimum number of particles that will be spawned every second. 每秒會產生的粒子的最小數目。

Max Emission

最大發射

The maximum number of particles that will be spawned every second. 每秒會產生的粒子的最大數目。

World Velocity

世界速度

The starting speed of particles in world space, along X, Y, and Z. 在世界空間中粒子的初始速度,沿X,Y和Z軸方向。

Local Velocity

相對速度

The starting speed of particles along X, Y, and Z, measured in the object's orientation. 粒子沿X,Y和Z軸方向的初始速度,以對象的定向為測量基准(意思就是粒子以某個對象為參照的相對速度)

Rnd Velocity

隨機速度

A random speed along X, Y, and Z that is added to the velocity. 沿X,Y和Z的隨機的加速度

Emitter Velocity Scale

發射器速度比例

The amount of the emitter's speed that the particles inherit. 粒子繼承的發射器速度的總和

Tangent Velocity

切線速度

The starting speed of particles along X, Y, and Z, across the Emitter's surface. 粒子沿X,Y和Z跨越發射器表面的初始速度

Simulate In World Space

模擬世界空間

If enabled, the particles don't move when the emitter moves. If false, when you move the emitter, the particles follow it around. 如果啟用,發射器移動時粒子不動;如果禁用,發射器移動時,粒子則跟隨在周圍

One Shot

單次發射

If enabled, the particle numbers specified by min & max emission is spawned all at once. If disabled, the particles are generated in a long stream. 如果啟用,粒子數是最小和最大數目之間的一個數(?)。如果禁用,這些粒子將產生一個粒子流。

Ellipsoid

橢球

Scale of the sphere along X, Y, and Z that the particles are spawned inside. 沿X,Y和Z產生粒子的球形范圍

MinEmitterRange

最小發射器范圍

Determines an empty area in the center of the sphere - use this to make particles appear on the edge of the sphere. 在球形的中心確定一個空白區域——用此來使粒子出現在該球形的邊緣

Details(細節)

Ellipsoid Particle Emitters (EPEs) are the basic emitter, and are included when you choose to add a Particle System to your scene from Components->Particles->Particle System. You can define the boundaries for the particles to be spawned, and give the particles an initial velocity. From here, use the Particle Animator to manipulate how your particles will change over time to achieve interesting effects. 

橢球粒子發射器(EPEs)是基本的發射器,當你選擇添加一個粒子系統到場景時,通過菜單Components->Particles->Particle System。你可以定義產生粒子的邊界,並給出粒子的初速度。從這里,使用粒子動畫器操縱你的粒子隨時間實現有趣的效果。

Particle Emitters work in conjunction with Particle Animators and Particle Renderers to create, manipulate, and display Particle Systems. All three Components must be present on an object before the particles will behave correctly. When particles are being emitted, all different velocities are added together to create the final velocity. 

粒子發射器與粒子動畫器和粒子渲染器一起工作來創建、處理和顯示粒子系統。在粒子正確表現之前這三個組成部分都必須呈現在對象上。當粒子被發射,所有不同的速度相加成為最終的速度。

Spawning Properties(屬性)

Spawning properties like Size, Energy, Emission, and Velocity will give your particle system distinct personality when trying to achieve different effects. Having a small Size could simulate fireflies or stars in the sky. A large Size could simulate dust clouds in a musky old building. 

產生粒子的屬性,如尺寸、活力、發射、和速度將在你試圖達到不同的效果時,給你的粒子系統鮮明的個性。用一個小的尺寸可以模擬螢火蟲或天空中的星星,大尺寸的可以模擬塵埃雲。

Energy and Emission will control how long your particles remain onscreen and how many particles can appear at any one time. For example, a rocket might have high Emission to simulate density of smoke, and high Energy to simulate the slow dispersion of smoke into the air. 

活力和發射將控制你的屏幕上粒子將保留多久以及一次可以產生多少粒子。例如,火箭可能有較高的發射來模擬濃煙,較高的活力來模擬煙霧在空氣中緩慢擴散。

Velocity will control how your particles move. You might want to change your Velocity in scripting to achieve interesting effects, or if you want to simulate a constant effect like wind, set your X and Z Velocity to make your particles blow away. 

速度將控制你的粒子如何運動。你可能希望通過腳本來改變速度以實現有趣的效果,或者如果你要模擬一個持續效果,比如風,設定你的X和Z的速度,使你的粒子被吹走。

Simulate in World Space(模擬世界空間)

If this is disabled, the position of each individual particle will always translate relative to the Position of the emitter. When the emitter moves, the particles will move along with it. If you have Simulate in World Space enabled, particles will not be affected by the translation of the emitter. For example, if you have a fireball that is spurting flames that rise, the flames will be spawned and float up in space as the fireball gets further away. If Simulate in World Space is disabled, those same flames will move across the screen along with the fireball. 

如果該項被禁用,每個粒子的位置將始終相對於發射器的位置在變化。當發射器移動時,粒子將跟隨它移動。如果啟用該項,粒子將不會受到發射器移動的影響。例如,如果你有一個火球,它噴出的火焰是上升的,火焰會產生然后上浮在空中,離火球越來越遠。如果模擬世界空間被禁用,相同的火焰會隨着火球在屏幕上移動。

Emitter Velocity Scale(發射器速度比例)

This property will only apply if Simulate in World Space is enabled. 

If this property is set to 1, the particles will inherit the exact translation of the emitter at the time they are spawned. If it is set to 2, the particles will inherit double the emitter's translation when they are spawned. 3 is triple the translation, etc. 

此屬性將只適用於模擬世界空間被啟用時。

如果此屬性設置為1,粒子將在它們產生時精確繼承發射器的變換(速度)。如果設置為2,粒子將繼承雙倍的發射器變換(速度)。設置為3則是三倍等等。

One Shot(單次發射)

One Shot emitters will create all particles within the Emission property all at once, and cease to emit particles over time. Here are some examples of different particle system uses with One Shot Enabled or Disabled: 

單次發射器將一次性創建Emission屬性中(指定的數目)的所有的粒子,然后停止發射粒子。下面是單次發射啟用或禁用時一些不同的粒子系統的例子:

Enabled: 啟用時:

· Explosion 爆炸

· Water splash 水花飛濺

· Magic spell 魔法效果

Disabled: 禁用時:

· Gun barrel smoke 槍筒的煙

· Wind effect 風的效果

· Waterfall 瀑布

Min Emitter Range(最小發射器范圍)

The Min Emitter Range determines the depth within the ellipsoid that particles can be spawned. Setting it to 0 will allow particles to spawn anywhere from the center core of the ellipsoid to the outer-most range. Setting it to 1 will restrict spawn locations to the outer-most range of the ellipsoid. 

最小發射器范圍決定了可以產生粒子的橢球的內部深度。將其設置為0將允許從橢球中心到最外層的范圍內任何地方產生粒子。將其設置為1將限制產生地點為橢球最外層。


Min Emitter Range of 0最小發射器范圍設置為0


Min Emitter Range of 1最小發射器范圍設置為1

Hints(提示)

· Be careful of using many large particles. This can seriously hinder performance on low-level machines. Always try to use the minimum number of particles to attain an effect. 

· The Emit property works in conjunction with the AutoDestruct property of the Particle Animator. Through scripting, you can cease the emitter from emitting, and then AutoDestruct will automatically destroy the Particle System and the GameObject it is attached to. 

· 使用大量粒子時要小心,這會嚴重妨礙低配置機器的性能。始終嘗試用最小的粒子數目達到效果。

· Emit屬性要與粒子動畫的AutoDestruct(自動銷毀)屬性結合使用。通過腳本,你可以停止發射器,然后AutoDestruct會自動銷毀粒子系統和它所附屬的游戲對象。

Mesh Particle Emitter(網格粒子發射器)

The Mesh Particle Emitter emits particles around a mesh. Particles are spawned from the surface of the mesh, which can be necessary when you want to make your particles interact in a complex way with objects. 

網格粒子發射器在一個網格周圍發射粒子。粒子從網格的表面產生,它適用於你想讓粒子與物體通過復雜的方式相互作用的情況。


The Mesh Particle Emitter Inspector網格粒子發射器的檢視視圖

Properties(屬性)

 

 

Emit 發射

If enabled, the emitter will emit particles. 如果啟用,發射器將發射粒子

Min Size

最小尺寸

The minimum size each particle can be at the time when it is spawned. 在產生粒子時每個粒子可以達到的最小尺寸。

Max Size

最大尺寸

The maximum size each particle can be at the time when it is spawned. 在產生粒子時每個粒子可以達到的最大尺寸。

Min Energy

最小活力

The minimum lifetime of each particle, measured in seconds. 每個粒子的最短壽命,以秒為單位。

Max Energy

最大活力

The maximum lifetime of each particle, measured in seconds. 每個粒子的最長壽命,以秒為單位。

Min Emission

最小發射

The minimum number of particles that will be spawned every second. 每秒會產生的粒子的最小數目。

Max Emission

最大發射

The maximum number of particles that will be spawned every second. 每秒會產生的粒子的最大數目。

World Velocity

世界速度

The starting speed of particles in world space, along X, Y, and Z. 在世界空間中粒子的初始速度,沿X,Y和Z軸方向。

Local Velocity

相對速度

The starting speed of particles along X, Y, and Z, measured in the object's orientation. 粒子沿X,Y和Z軸方向的初始速度,以對象的定向為測量基准

Rnd Velocity

隨機速度

A random speed along X, Y, and Z that is added to the velocity. 沿X,Y和Z的隨機的加速度

Emitter Velocity Scale

發射器速度比例

The amount of the emitter's speed that the particles inherit. 粒子繼承的發射器速度的總和

Tangent Velocity

切線速度

The starting speed of particles along X, Y, and Z, across the Emitter's surface. 粒子沿X,Y和Z跨越發射器表面的初始速度

Simulate In World Space

模擬世界空間

If enabled, the particles don't move when the emitter moves. If false, when you move the emitter, the particles follow it around. 如果啟用,發射器移動時粒子不動;如果禁用,發射器移動時,粒子則跟隨在周圍

One Shot

單次發射

If enabled, the particle numbers specified by min & max emission is spawned all at once. If disabled, the particles are generated in a long stream. 如果啟用,粒子數是最小和最大數目之間的隨機數(?)。如果禁用,這些粒子將產生一個粒子流。

Interpolate Triangles

插值三角形

If enabled, particles are spawned all over the mesh's surface. If disabled, particles are only spawned from the mesh's vertrices. 如果啟用,粒子將產生在網格的表面上;如果禁用,粒子僅從網格的頂點產生

Systematic

系統的

If enabled, particles are spawned in the order of the vertices defined in the mesh. Although you seldom have direct control over vertex order in meshes, most 3D modelling applications have a very systematic setup when using primitives. It is important that the mesh contains no faces in order for this to work. 如果啟用,粒子將按網格定義的頂點順序來產生。雖然你很少直接控制網格頂點順序,但在初始使用時大多數3D建模程序中有非常系統的設置。這在網格沒有表面的時候是很重要的。

Min Normal Velocity

最小正常速率

Minimum amount that particles are thrown away from the mesh.從網格拋出的粒子的最小數目

Max Normal Velocity

最大正常速率

Maximum amount that particles are thrown away from the mesh.從網格拋出的粒子的最大數目

Details(細節)

Mesh Particle Emitters (MPEs) are used when you want more precise control over the spawn position & directions than the simpler Ellipsoid Particle Emitter gives you. They can be used for making advanced effects. 

MPEs work by emitting particles at the vertices of the attached mesh. Therefore, the areas of your mesh that are more dense with polygons will be more dense with particle emission. 

Particle Emitters work in conjunction with Particle Animators and Particle Renderers to create, manipulate, and display Particle Systems. All three Components must be present on an object before the particles will behave correctly. When particles are being emitted, all different velocities are added together to create the final velocity. 

網格粒子發射器(MPEs)用來更精確地控制粒子生成位置和方向,比橢球粒子發射器更簡單。它們可用於制造高級的效果。

MPEs通過附屬網格的頂點發射粒子。因此,你的網格區域的多邊形越密集,粒子發射也就越密集。

粒子發射器與粒子動畫器和粒子渲染器一起工作來創建、處理和顯示粒子系統。在粒子正確表現之前這三個組成部分都必須呈現在對象上。當粒子被發射,所有不同的速度相加成為最終的速度。

Spawning Properties(屬性)

Spawning properties like Size, Energy, Emission, and Velocity will give your particle system distinct personality when trying to achieve different effects. Having a small Size could simulate fireflies or stars in the sky. A large Size could simulate dust clouds in a musky old building. 

產生粒子的屬性,如尺寸、活力、發射、和速度將在你試圖達到不同的效果時,給你的粒子系統鮮明的個性。用一個小的尺寸可以模擬螢火蟲或天空中的星星,大尺寸的可以模擬塵埃雲。

Energy and Emission will control how long your particles remain onscreen and how many particles can appear at any one time. For example, a rocket might have high Emission to simulate density of smoke, and high Energy to simulate the slow dispersion of smoke into the air. 

活力和發射將控制你的屏幕上粒子將保留多久以及一次可以產生多少粒子。例如,火箭可能有較高的發射來模擬濃煙,較高的活力來模擬煙霧在空氣中緩慢擴散。

Velocity will control how your particles move. You might want to change your Velocity in scripting to achieve interesting effects, or if you want to simulate a constant effect like wind, set your X and Z Velocity to make your particles blow away. 

速度將控制你的粒子如何運動。你可能希望通過腳本來改變速度以實現有趣的效果,或者如果你要模擬一個持續效果,比如風,設定你的X和Z的速度,使你的粒子被吹走。

Simulate in World Space(模擬世界空間)

If this is disabled, the position of each individual particle will always translate relative to the Position of the emitter. When the emitter moves, the particles will move along with it. If you have Simulate in World Space enabled, particles will not be affected by the translation of the emitter. For example, if you have a fireball that is spurting flames that rise, the flames will be spawned and float up in space as the fireball gets further away. If Simulate in World Space is disabled, those same flames will move across the screen along with the fireball. 

如果該項被禁用,每個粒子的位置將始終相對於發射器的位置在變化。當發射器移動時,粒子將跟隨它移動。如果啟用該項,粒子將不會受到發射器移動的影響。例如,如果你有一個火球,它噴出的火焰是上升的,火焰會產生然后上浮在空中,離火球越來越遠。如果模擬世界空間被禁用,相同的火焰會隨着火球在屏幕上移動。

Emitter Velocity Scale(發射器速度比例)

This property will only apply if Simulate in World Space is enabled. 

If this property is set to 1, the particles will inherit the exact translation of the emitter at the time they are spawned. If it is set to 2, the particles will inherit double the emitter's translation when they are spawned. 3 is triple the translation, etc. 

此屬性將只適用於模擬世界空間被啟用時。

如果此屬性設置為1,粒子將在它們產生時精確繼承發射器的變換(速度)。如果設置為2,粒子將繼承雙倍的發射器變換(速度)。設置為3則是三倍等等。

One Shot(單次發射)

One Shot emitters will create all particles within the Emission property all at once, and cease to emit particles over time. Here are some examples of different particle system uses with One Shot Enabled or Disabled: 

單次發射器將一次性創建Emission屬性中(指定的數目)的所有的粒子,然后停止發射粒子。下面是單次發射啟用或禁用時一些不同的粒子系統的例子:

Enabled: 啟用時:

· Explosion 爆炸

· Water splash 水花飛濺

· Magic spell 魔法效果

Disabled: 禁用時:

· Gun barrel smoke 槍筒的煙

· Wind effect 風的效果

· Waterfall 瀑布

Interpolate Triangles(插值三角形)

Enabling your emitter to Interpolate Triangles will allow particles to be spawned between the mesh's vertices. This option is off by default, so particles will only be spawned at the vertices. 

讓你的發射器啟用插值三角形,將允許粒子在網格的頂點之間產生。這個選項默認是關閉的,所以粒子僅會產生在頂點上。


A sphere with Interpolate Triangles off (the default)插值三角形關閉(默認情況)的一個球體

Enabling this option will spawn particles on and in-between vertices, essentially all over the mesh's surface (seen below). 

啟用此選項粒子將產生在頂點上且在頂點之間,基本上全部是在網格的表面(如下圖)。


A sphere with Interpolate Triangles on插值三角形打開的一個球體

It bears repeating that even with Interpolate Triangles enabled, particles will still be denser in areas of your mesh that are more dense with polygons. 

必需重申的是,即使啟用插值三角形,粒子仍然會堆積在你的網格多邊形比較密集的區域。

Systematic(系統)

Enabling Systematic will cause your particles to be spawned in your mesh's vertex order. The vertex order is set by your 3D modeling application. 

啟用該項將導致你的粒子會按你的網格頂點順序產生,頂點順序是由你的三維建模程序設置的。


An MPE attached to a sphere with Systematic enabled開啟系統的一個球體粒子系統

Normal Velocity(正常速率)

Normal Velocity controls the speed at which particles are emitted along the normal from where they are spawned. 

For example, create a Mesh Particle System, use a cube mesh as the emitter, enable Interpolate Triangles, and set Normal Velocity Min and Max to 1. You will now see the particles emit from the faces of the cube in a straight line. 

正常速率控制粒子在它們產生的地方正常放出的速度。

例如,創建一個網格粒子系統,用一個立方體作發射器,使用插值三角形,並設置正常速率的最小和最大值為1。現在你將看到粒子從立方體表面沿一條直線排放出來。

See Also(參見)

· How to make a Mesh Particle Emitter 

Hints(提示)

· Be careful of using many large particles. This can seriously hinder performance on low-level machines. Always try to use the minimum number of particles to attain an effect. 

· The Emit property works in conjunction with the AutoDestruct property of the Particle Animator. Through scripting, you can cease the emitter from emitting, and then AutoDestruct will automatically destroy the Particle System and the GameObject it is attached to. 

· MPEs can also be used to make glow from a lot of lamps placed in a scene. Simply make a mesh with one vertex in the center of each lamp, and build an MPE from that with a halo material. Great for evil sci-fi worlds. 

· 使用大量粒子時要小心,這會嚴重妨礙低配置機器的性能。始終嘗試用最小的粒子數目達到效果。

· Emit屬性要與粒子動畫的AutoDestruct(自動銷毀)屬性結合使用。通過腳本,你可以停止發射器,然后AutoDestruct會自動銷毀粒子系統和它所附屬的游戲對象。

· MPEs也可用於讓場景中放置的大量燈來發光。只需在每盞燈的中心頂點建立一個網格,並使用一個光暈材質建立網格粒子系統。(用它來創建一個)非常棒的邪惡的科幻世界。

Particle Animator(粒子動畫器)

Particle Animators move your particles over time, you use them to apply wind, drag & color cycling to your particle systems. 

粒子動畫器隨着時間移動你的粒子,使用它們應用風、拖放和顏色循環到你的粒子系統(什么意思啊)。


The Particle Animator Inspector粒子動畫器的檢視視圖

Properties(屬性)

 

 

Does Animate Color

使用動畫顏色

If enabled, particles cycle their color over their lifetime. 如果啟用,粒子在持續時間內將輪換使用顏色。

Color Animation

動畫顏色

The 5 colors particles go through. All particles cycle over this - if some have a shorter life span than others, they will animate faster. 列出5種粒子的顏色。所有粒子輪換使用這些顏色——如果有的粒子壽命比別的短,他們將動得更快。

World Rotation Axis

世界旋轉軸

An optional world-space axis the particles rotate around. Use this to make advanced spell effects or give caustic bubbles some life. 可選的世界空間軸,粒子在其周圍旋轉。使用它可制造高級法術效果,或提供一些腐蝕性泡沫。

Local Rotation Axis

本地旋轉軸

An optional local-space axis the particles rotate around. Use this to make advanced spell effects or give caustic bubbles some life. 可選的本地空間軸,粒子在其周圍旋轉。使用它可制造高級法術效果,或提供一些腐蝕性泡沫。

Size Grow

擴大規模

Use this to make particles grow in size over their lifetime. As randomized forces will spread your particles out, it is often nice to make them grow in size so they don't fall apart. Use this to make smoke rise upwards, to simulate wind, etc. 用它來使粒子在其壽命范圍內擴大規模。由於隨機力量將向外散播你的粒子,擴大它們的規模往往是不錯的,它們不會四分五裂。用它可以模擬煙的上升,模擬風等。

Rnd Force

隨機外力

A random force added to particles every frame. Use this to make smoke become more alive. 每一幀都給粒子隨機力量。用它來讓煙霧變得更活躍。

Force

外力

The force being applied every frame to the particles, measure relative to the world. 每一幀都給粒子應用力量,以相對世界為基准。

Damping

減幅

How much particles are slowed every frame. A value of 1 gives no damping, while less makes them slow down. 每一幀有多少粒子會變慢。值1是無阻尼使他們慢下來

Autodestruct

自動銷毀

If enabled, the GameObject attached to the Particle Animator will be destroyed when all particles disappear. 如果啟用,所有的粒子消失時,附着了粒子動畫的游戲對象將被銷毀。

Details(細節)

Particle Animators allow your particle systems to be dynamic. They allow you to change the color of your particles, apply forces and rotation, and choose to destroy them when they are finished emitting. For more information about Particle Systems, reference Mesh Particle Emitters, Ellipsoid Particle Emitters, and Particle Renderers. 

粒子動畫器讓你的粒子系統是動態的。它們允許你改變粒子的顏色,應用外力和旋轉,並在它們完成發射時選擇摧毀。如需粒子系統的更多信息,參考Mesh Particle Emitters, Ellipsoid Particle Emitters, Particle Renderers。

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. 

如果你想讓粒子改變顏色或淡入/淡出,使用動畫顏色為它們指定周期內色彩。使用動畫顏色的任何粒子系統將循環使用你選擇的5種顏色。發射器的活力值決定了它們的周期內速度。

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

如果你想讓你的粒子漸顯(淡入)而不是立即出現,設置你的第一個或最后一個顏色,使其有一個較低的Alpha值(意思就是設置為較低的透明度)。


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. 

無論設定本地還是世界旋轉軸,都將導致所產生的粒子繞軸表示(使用Transform組件位置作為中心)。在這些軸上鍵入更大的值,則旋轉會更快。

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. 

設置本地軸的值將導致旋轉粒子調整它們的旋轉,作為Transform組件的旋轉變化,以配合本地軸。

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

設置世界軸的值將導致粒子的旋轉是始終如一的,而不管Transform組件的旋轉。

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. 

· A value of 0 means particles will stop immediately. 

· A value of 2 means particles will double their speed every second. 

· 值為1表示沒有阻尼應用,這些粒子將不會減速或加速。

· 值為0表示粒子將立即停止。

· 值為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. 

你可以通過啟用AutoDestruct屬性破壞粒子系統和任意游戲對象的附屬關系。例如,如果你有一個油桶,可以附着一個粒子系統,該系統Emit禁用,AutoDestruct啟用。發生碰撞,你啟用粒子發射器,爆炸發生並結束后,粒子系統和油桶將被摧毀,並從現場刪除。

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. 

· 如果一些粒子已經產生,但它們都失效了,或者

· 如果發射器Emit屬性在某些點打開,但現在Emit屬性關閉了

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. 

· 使用動畫顏色,讓你的粒子在它們的持續時間內淡入淡出——否則,你會得到很難看的泡泡(pops)。

· 使用旋轉軸來制作旋渦狀運動。

Particle Collider(粒子碰撞器)

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

世界粒子碰撞器是用來對場景中的其他碰撞體發生粒子碰撞。


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. 粒子在與其他物體碰撞時,可以加速或減緩。該屬性與粒子動畫的阻尼屬性類似。

Collision Energy Loss

碰撞活力丟失

Amount of energy (in seconds) a particle should lose when colliding. If the energy goes below 0, the particle is killed. 粒子碰撞時丟失的活力總和(每秒)。如果低於0,粒子被消滅。

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 

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

1. 利用菜單GameObject->Create Other->Particle System創建一個粒子系統

2. 使用Component->Particles->World Particle Collider添加粒子碰撞。

Messaging(傳送消息)

If Send Collision Message is enabled, any particles that are in a collision will send the message OnParticleCollision() to both the particle's GameObject and the GameObject the particle collided with. 

如果啟用了Send Collision Message,發生碰撞的粒子將發送消息OnParticleCollision()到這兩個對象——粒子對象和與粒子相撞的對象。

Hints(提示)

· Send Collision Message can be used to simulate bullets and apply damage on impact. 

· Particle Collision Detection is slow when used with a lot of particles. Use Particle Collision Detection wisely. 

· Message sending introduces a large overhead and shouldn't be used for normal Particle Systems. 

· 發送碰撞消息可用於模擬子彈和運用撞擊損壞

· 使用很多粒子時,粒子碰撞檢測是緩慢的。明智地使用粒子碰撞檢測。

· 消息發送引入了大量的開銷,不應該用於正常的粒子系統。

Particle Renderer(粒子渲染器)

The Particle Renderer renders the Particle System on screen. 

粒子渲染器在屏幕上渲染粒子系統。


The Particle Renderer Inspector粒子渲染器檢視視圖

Properties(屬性)

 

 

Materials

材質

Reference to a list of Materials that will be displayed in the position of each individual particle. 將在每個粒子個體的位置顯示的材質參考清單。

Camera Velocity Scale相機速度比例

The amount of stretching that is applied to the Particles based on Camera movement.基於相機運動的粒子的伸展總量。

Stretch Particles

展開粒子

Determines how the particles are rendered. 確定粒子如何被渲染

Billboard布告板

The particles are rendered as if facing the camera.粒子好像面對鏡頭被渲染

Stretched伸展

The particles are facing the direction they are moving. 粒子面對它們正在移動的方向

SortedBillboard

分類布告板

The particles are sorted by depth. Use this when using a blending material. 粒子按深度分類。當使用混合材質時用這個選項。

VerticalBillboard

垂直布告板

All particles are aligned flat along the X/Z axes. 所有的粒子沿X / Z軸對准平面

HorizontalBillboard

水平布告板

All particles are aligned flat along the X/Y axes. 所有的粒子沿X / Y軸對准平面

Length Scale

長度比例

If Stretch Particles is set to Stretched, this value determines how long the particles are in their direction of motion. 如果展開粒子設置為伸展,這個值決定粒子在其運動方向有多長。

Velocity Scale

速度比例

If Stretch Particles is set to Stretched, this value determines the rate at which particles will be stretched, based on their movement speed. 如果展開粒子設置為伸展,這個值決定粒子將被拉伸的比率,以它們的運動速率為基准

UV Animation

UV動畫

If either of these are set, the UV coordinates of the particles will be generated for use with a tile animated texture. See the section on Animated Textures below. 如果任何一個被設置,粒子的UV坐標將使用動畫紋理來生成。查看下面關於動畫紋理的部分

X Tile  X貼片

Number of frames located across the X axis.橫穿X軸的幀數

Y Tile  Y貼片

Number of frames located across the Y axis.橫穿Y軸的幀數

Cycles 循環

How many times to loop the animation sequence.動畫序列的循環次數

Details(細節)

Particle Renderers are required for any Particle Systems to be displayed on the screen. 

粒子渲染器對於任何粒子系統在屏幕上的顯示是必需的。


A Particle Renderer makes the Gunship's engine exhaust appear on the screen一個粒子渲染器使武裝直升機的發動機排氣出現在屏幕上

Choosing a Material(選擇材質)

When setting up a Particle Renderer it is very important to use an appropriate material and shader that renders both sides of the material. Most of the time you want to use a Material with one of the built-in Particle Shaders. There are some premade materials in the Standard Assets->Particles->Sources folder that you can use. 

當建立一個粒子渲染器,使用適當的材質和渲染材質兩面的着色器是非常重要的。大部分時間你想使用的材質都有一個內置的粒子着色器。在標准資源Standard Assets->Particles->Sources文件夾中,你可以使用一些預制材質。

Creating a new material is easy: 創建一個新材質很容易:

1. Select Assets->Create Other->Material from the menu bar. 

2. The Material has a shader popup, choose one of the shaders in the Particles group. Eg. Particles->Multiply. 

3. Now assign a Texture. The different shaders use the alpha channel of the textures slightly differently, but most of the time a value of black will make it invisible and white in the alpha channel will display it on screen. 

1. 從菜單條選擇Assets->Create Other->Material

2. 材質具有着色器彈出窗口,在粒子組中選擇一種着色器。例如,粒子->多樣的

3. 現在,分配一個紋理。不同的着色器使用的紋理alpha通道略有不同,但大部分時間黑色值將會不可見,alpha通道中的白色將顯示在屏幕上。

Distorting particles(扭曲粒子)

By default particles are rendered billboarded. That is simple square sprites. This is good for smoke and explosions and most other particle effects. 

默認情況下粒子用布告板方式渲染。這是簡單的方形,這對於煙霧、爆炸和其它大部分粒子效果是比較好的。

Particles can be made to either stretch with the velocity. This is useful for sparks, lightning or laser beams. Length Scale and Velocity Scale affects how long the stretched particle will be. 

粒子可向任意速度方向伸展。這對於火花、閃電或激光束是有用的。長度比例和速度比例影響粒子可伸展的長度。

Sorted Billboard can be used to make all particles sort by depth. Sometimes this is necessary, mostly when using Alpha Blended particle shaders. This can be expensive and should only be used if it really makes a quality difference when rendering. 

分類布告板可以用來使所有粒子按深度分類。有時候這是必要的,主要是在使用Alpha混合粒子着色器時。如果它真的在渲染時造成質量差異,那么這也可以是花費浩大的,唯一被使用的。

Animated textures(動畫紋理)

Particle Systems can be rendered with an animated tile texture. To use this feature, make the texture out of a grid of images. As the particles go through their life cycle, they will cycle through the images. This is good for adding more life to your particles, or making small rotating debris pieces. 

粒子系統可以使用動畫貼圖紋理來渲染。要使用此功能,把紋理輸出到圖像柵格中。由於粒子通過其生命周期去(運動),它們將通過圖像來周期循環。這對於給你的粒子增加更多的生命,或制作小的旋轉碎片是比較好的。

Hints(提示)

· Use Particle Shaders with the Particle Renderer. 

· 和粒子渲染器一起使用粒子着色器


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM