public static RaycastHit2D[] BoxCastAll (Vector2 origin, Vector2 size, float angle, Vector2 direction, float distance= Mathf.Infinity, int layerMask= DefaultRaycastLayers, float minDepth= -Mathf.Infinity, float maxDepth= Mathf.Infinity);
参数
origin | 盒体在 2D 空间中的起点。 |
size | 盒体的大小。 |
angle | 盒体的角度(以度为单位)。 |
direction | 表示盒体方向的矢量。 |
distance | 盒体的最大投射距离。 |
layerMask | 过滤器,用于仅在特定层上检测碰撞体。 |
minDepth | 仅包括 Z 坐标(深度)大于或等于该值的对象。 |
maxDepth | 仅包括 Z 坐标(深度)小于或等于该值的对象。 |
origin:盒体的中心(实际使用时),设置为起点时,检测有问题