The Built-in Particle System uses a component, so placing a Particle System in a Scene is a matter of adding a pre-made GameObject (menu: GameObject > Effects > Particle System) or adding the component to an existing GameObject (menu: Component > Effects > Particle System). Because the component is quite complicated, the Inspector is divided into a number of collapsible sub-sections or modules that each contain a group of related properties. Additionally, you can edit one or more systems at the same time using a separate Editor window accessed via the Open Editor button in the Inspector. See documentation on the Particle System component and individual Particle System modules to learn more.
选择带有粒子系统的游戏对象时,Scene 视图包含一个小的 Particle Effect 面板,其中有一些简单控件,用于显示对系统设置的更改。
Playback Speed 用于加快或减慢粒子模拟速度,可以直观查看在高级状态下的效果。Playback Time 表示自系统启动以来经过的时间;这可能比实时更快或更慢,具体取决于播放速度。Particle Count 表示系统中当前有多少粒子。通过单击 Playback Time 标签并向左和向右拖动鼠标,即可前后移动播放时间。面板顶部的按钮可用于暂停和恢复模拟,或停止模拟并重置为初始状态。
粒子甚至整个粒子系统的许多数字属性都可能随时间而变化。Unity 提供了几种不同的方法来指定这种变化的发生方式:
将属性设置为 Curve 或 Random Between Two Curves 时,粒子系统曲线编辑器 (Particle System Curves Editor) 将显示在 Inspector 的底部:
要编辑曲线,请单击并拖动结束点或关键点以调整曲线形状:
粒子系统曲线与动画曲线类似。如需了解关于使用曲线的更多信息,请参阅有关编辑曲线的文档。
粒子系统曲线编辑器具有以下按钮:
要编辑粒子系统播放曲线的方式,请单击所选关键点旁边的齿轮图标,然后选择以下选项之一:
主模块中的 Start Color 属性具有以下选项:
其他颜色属性(例如 Color over Lifetime__)可以使用 Gradient__ 或 Random Between Two Gradients 模式。
要计算最终的粒子颜色结果,粒子系统将各种模块中的颜色属性按照每个通道相乘。
为粒子设置 Gradient 颜色时,将显示渐变编辑器 (Gradient Editor):
各种模块中的颜色属性按照每个通道相乘,从而计算出最终的粒子颜色结果。
动画系统可以访问所有粒子属性,这意味着可以将它们设置到关键帧中并从动画中控制它们。
要访问粒子系统的属性,必须有一个 Animator 组件连接到粒子系统的游戏对象。此外还需要动画控制器 (Animation Controller) 和动画。
要动画化粒子系统属性,请打开 Animation 窗口__,并选择包含 Animator 和粒子系统的游戏对象。单击 Add Property__ 以添加属性。
向右滚动以显示__添加控件__。
请注意,对于曲线,只能对整体__曲线乘数__进行关键帧设置(可在 Inspector 中的曲线编辑器旁边找到该曲线乘数)。
2019–04–16 页面已修订
在 Unity 4.6 中更改了 GameObject 菜单
在 2018.3 版中添加了粒子系统 Loop/Ping-Pong 曲线播放 NewIn20183
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.