Version: 2020.3
言語: 日本語
public static Collider2D[] OverlapBoxAll (Vector2 point, Vector2 size, float angle, int layerMask= DefaultRaycastLayers, float minDepth= -Mathf.Infinity, float maxDepth= Mathf.Infinity);

パラメーター

point The center of the box.
size The size of the box.
angle The angle of the box.
layerMask 特定レイヤーのオブジェクトのみを判定するフィルター
minDepth この値よりも大きな Z 座標(深度)にあるオブジェクトのみを含む
maxDepth この値よりも小さな Z 座標(深度)のオブジェクトのみを含む

戻り値

Collider2D[] 投げかけた結果が返されます。

説明

Get a list of all Colliders that fall within a box area.

This function is similar to OverlapBox except that all Colliders that fall within the box are returned. The Colliders in the returned array are sorted in order of increasing Z coordinate. An empty array is returned if there are no Colliders within the box.

この関数は返された Collider2D オブジェクト配列にメモリを割り当てることに注意してください。頻繁に判定を行なう必要がある場合 OverlapBoxNonAlloc を使用することでオーバーヘッドを回避できます。

See Also: OverlapBox, OverlapBoxNonAlloc.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961