__2D 盒型碰撞体__组件是用于 2D 物理的碰撞体。该碰撞体的形状是矩形,在__精灵__的局部坐标空间中具有定义的位置、宽度和高度。请注意,矩形为轴对齐,即矩形的边与局部空间的 X 或 Y 轴平行。
属性 | 功能 |
---|---|
Density | Changing the density here affects the mass of the GameObject’s associated Rigidbody 2D. Set the value to 0 and its associated Rigidbody 2D ignores the Collider 2D for all mass calculations, including center of mass calculations. Note that this option is only available if you have selected Use Auto Mass in an associated Rigidbody 2D component. |
Material | 一种物理材质,可用于确定碰撞的属性(例如摩擦和弹性)。 |
Is Trigger | 如果希望 2D 盒型碰撞体作为触发器运行,请选中此框。 |
Used by Effector | 如果希望 2D 盒型碰撞体由附加的 2D 效应器组件使用,请选中此框。 |
Used by Composite | Tick this checkbox if you want this Collider to be used by an attached Composite Collider 2D. When you enable Used by Composite, other properties disappear from the Box Collider 2D component, because they are now controlled by the attached Composite Collider 2D. The properties that disappear from the Box Collider 2D are Density, Material, Is Trigger, Used By Effector, and Edge Radius. |
Auto Tiling | 如果所选精灵的精灵渲染器 (Sprite Renderer) 组件将 Draw Mode 设置为 Tiled__,请勾选此复选框。这样可以自动更新 2D 碰撞体的形状,意味着精灵的尺寸变化时,会自动重新调整形状。如果没有启用 Auto Tiling__,2D 碰撞体几何形状不会自动重复。 |
Offset | 设置 2D 碰撞体几何形状的局部偏移。 |
Size | 按局部空间单位设置盒体的大小。 |
Edge Radius | 控制边缘周围的半径,使顶点为圆形。这会产生一个具有圆凸角的更大 2D 碰撞体。此设置的默认值是 __0__(无半径)。 |