Edge Collider 2D 组件是用于 2D 物理的碰撞体。碰撞体的形状是线段组成的自由形状边界,可对其进行调整以适应精灵图形的形状或其他形状。此碰撞体起点和终点无需重合以完全包围一个区域(与 2D 多边形碰撞体 (Polygon Collider 2D) 不同),可以是直线或其他单一边界形状。
属性 | 功能 |
---|---|
Edit Collider | 选择 Edit Polyline 按钮(折线图标)使碰撞体轮廓可编辑。有关启用 Edit Collider 时可用的快捷方式,请参阅下方的碰撞体快捷方式。 |
Material | 选择此碰撞体的 Physics Material 2D ,可确定该碰撞体与其他碰撞体的交互方式。 |
Is Trigger | 启用此属性可使该碰撞体充当触发器。 |
Used by Effector | 启用此属性可使附加的 Effector 2D 组件使用此碰撞体。 |
Offset X/Y | 设置 x/ y 相当于使碰撞体几何形状偏移。 |
Edge Radius | 设置一个值,以形成围绕碰撞体边界的半径。这会产生一个具有圆凸角的更大 2D 碰撞体。默认值为 0(没有半径)。 |
Points | 有关生成碰撞体的复杂性的不可编辑信息。 |
Use Adjacent Start Point | 启用此属性以使用 Adjacent Start Point 计算碰撞响应,以形成碰撞发生在边界碰撞体的起点时的碰撞法线。 |
Adjacent Start Point X/Y | 设置 Adjacent Start Point 的 x/y 坐标。 |
Use Adjacent End Point | 启用此属性以使用 Adjacent End Point 计算碰撞响应,以形成碰撞发生在边界碰撞体的终点时的碰撞法线。 |
Adjacent End Point X/Y | 设置 Adjacent End Point 的 x/y 坐标。 |
快捷键 | 功能 |
---|---|
按住并拖动顶点或边。 | 将选定的顶点和边移动到不同的位置。 |
单击边上的任意位置。 | 通过单击边上的空白区域创建一个新顶点。 |
按住 Ctrl (Windows) 或 Command (macOS) 键并选择一个顶点或边。 | 删除选定的顶点或边。 |
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.