要在地形和粒子系统上创建风的效果,可使用 Wind Zone 组件添加一个或多个游戏对象。风区内的树会以逼真的动画弯曲,而风本身以脉冲方式移动,从而在树之间营造自然的运动模式。
要直接创建风区游戏对象,请选择 Unity 的顶部菜单,然后转到 GameObject > 3D Object > Wind Zone。可将 Wind Zone 组件添加到 Scene 中任何适当的游戏对象(菜单:__Component__ > Miscellaneous > Wind Zone__)。Wind Zone 的 Inspector__ 提供了许多设置来控制其行为。
可将 Mode 设置为 Directional 或 Spherical。
Main 属性决定了风的整体强度,但可使用 Turbulence 带来一些随机变化。
风以脉冲方式吹过树,从而产生更自然的效果。可使用 Pulse Magnitude 控制脉冲强度,并使用 Pulse Frequency 设置脉冲之间的时间间隔。
属性: | 功能: |
---|---|
Mode | |
Spherical | 风区仅在半径内有效果,并且从中心向边缘衰减。 |
Directional | 风区在一个方向上影响整个场景。 |
Radius | 球形风区的半径(仅在模式设置为 Spherical 时才有效)。 |
Main | 施加到受风区影响的所有对象上的主风力。 |
Turbulence | 该值表示风的噪声。值越大,风向的变化越大。 |
Pulse Magnitude | 定义风脉冲强度乘数。 |
Pulse Frequency | 定义风脉冲长度和频率。 |
风的主要用途是实现树的动画化,但如果粒子系统使用External Forces 模块,那么也会影响粒子系统中的粒子。请参阅粒子系统参考页面以了解更多详细信息。
WindZone
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.