Version: 2019.2
public static int CapsuleCastNonAlloc (Vector3 point1, Vector3 point2, float radius, Vector3 direction, RaycastHit[] results, float maxDistance= Mathf.Infinity, int layerMask= DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction= QueryTriggerInteraction.UseGlobal);

パラメーター

point1カプセルの start にある球形の中心
point2カプセルの end にある球形の中心
radiusカプセルの半径
directionカプセル型の通過方向
results衝突情報を保存するバッファ
maxDistanceスイープの最大の長さ。
layerMask レイヤーマスク はレイキャストするときに選択的に衝突を無視するために使用します。
queryTriggerInteractionトリガーに設定されているものも検索対象にするか

戻り値

int バッファに保存された衝突情報の数

説明

Casts a capsule against all colliders in the Scene and returns detailed information on what was hit into the buffer.

Physics.CapsuleCastAll と似ていますがゴミを発生させません。