Buoyancy Effector 2D 定义简单的流体行为,例如浮动以及流体阻力和流量。还可以控制流体表面以及下方发生的流体行为。
属性: | 功能: |
---|---|
Use Collider Mask | 选中此框可启用“Collider Mask”属性。如果未启用此选项,则所有 2D 碰撞体都将默认采用全局碰撞矩阵 (Global Collision Matrix)。 |
Collider Mask | 此遮罩用于选择允许与效应器进行交互的特定层。请注意,仅在已选择 Use Collider Mask 的情况下,才显示此选项。 |
Surface Level | 定义浮力流体的表面位置。游戏对象高于此线时,不会对其施加浮力。游戏对象与此线相交或完全在此线下方时,将对其施加浮力。此位置指定为沿世界 y 轴的世界空间偏移,但也由游戏对象的__变换__组件缩放。 |
Density | 流体的密度。密度较大的碰撞体会下沉,密度较小的碰撞体会上浮,密度与流体相同的碰撞体会悬浮在流体中。 |
Linear Drag | 影响游戏对象位置移动的阻力系数。该系数仅适用于流体内部。 |
Angular Drag | 影响游戏对象旋转移动的阻力系数。该系数仅适用于流体内部。 |
Flow Angle | 流体流动方向的世界空间角度(以度为单位)。流体流动将沿指定方向施加浮力。 |
Flow Magnitude | 流体流动力的“力量”。此项与 Fluid Angle 结合,共同指定施加于流体内游戏对象的浮力水平。此大小也可以为负值,在此情况下,以相对于 Flow Angle 的 180 度方向施加浮力。 |
Flow Variation | 在此处输入一个随机改变流体力的值。可指定正负变化来表示 Fluid Magnitude 的随机加减值。 |
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.