__2D 盒型碰撞体__组件是用于 2D 物理的碰撞体。该碰撞体的形状是矩形,在__精灵__的局部坐标空间中具有定义的位置、宽度和高度。请注意,矩形为轴对齐,即矩形的边与局部空间的 X 或 Y 轴平行。
属性 | 功能 |
---|---|
Material | 一种物理材质,可用于确定碰撞的属性(例如摩擦和弹性)。 |
Is Trigger | 如果希望 2D 盒型碰撞体作为触发器运行,请选中此框。 |
Used by Effector | 如果希望 2D 盒型碰撞体由附加的 2D 效应器组件使用,请选中此框。 |
Used by Composite | 如果希望此碰撞体由附加的 2D 复合碰撞体 (Composite Collider 2D) 使用,请勾选此复选框。 启用 Used by Composite 时,其他属性会从 2D 盒型碰撞体组件中消失,因为这些属性现在由附加的 2D 复合碰撞体控制。从 2D 盒型碰撞体消失的属性为 Material、Is Trigger、Used By Effector 和 Edge Radius。 |
Auto Tiling | 如果所选精灵的精灵渲染器 (Sprite Renderer) 组件将 Draw Mode 设置为 Tiled__,请勾选此复选框。这样可以自动更新 2D 碰撞体的形状,意味着精灵的尺寸变化时,会自动重新调整形状。如果没有启用 Auto Tiling__,2D 碰撞体几何形状不会自动重复。 |
Offset | 设置 2D 碰撞体几何形状的局部偏移。 |
Size | 按局部空间单位设置盒体的大小。 |
Edge Radius | 控制边缘周围的半径,使顶点为圆形。这会产生一个具有圆凸角的更大 2D 碰撞体。此设置的默认值是 __0__(无半径)。 |
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.