返回介绍

Physics2D.OverlapCircleNonAlloc 重叠圆形不分配

发布于 2019-12-18 15:38:17 字数 2404 浏览 2013 评论 0 收藏 0

JavaScript => static function OverlapCircleNonAlloc(point: Vector2, radius: float, results: Collider2D[], layerMask: int = DefaultRaycastLayers, minDepth: float = -Mathf.Infinity, maxDepth: float = Mathf.Infinity): int;
C# => static int OverlapCircleNonAlloc(Vector2 point, float radius, Collider2D[] results, int layerMask = DefaultRaycastLayers, float minDepth = -Mathf.Infinity, float maxDepth = Mathf.Infinity);

Parameters 参数

pointCentre of the circle.
圆的中心点。
radiusRadius of the circle.
圆的半径。
resultsArray to receive results.
接收结果的数组。
layerMaskFilter to detect Colliders only on certain layers.
只在某些层过滤检测碰撞器。
minDepthOnly include objects with a Z coordinate (depth) greater than this value.
只包括Z坐标(深度)大于这个值的对象。
maxDepthOnly include objects with a Z coordinate (depth) less than this value.
只包括Z坐标(深度)小于这个值的对象。

Returns 返回值

int The number of results returned.
int 返回结果的数量。

Parameters 参数

Get a list of all colliders that fall within a circular area.
获取落入特殊圆形区域内的所有碰撞器列表。

This function is similar to OverlapCircleAll except that the results are returned in the supplied array. The integer return value is the number of objects that fall within the circle (possibly zero) but the results array will not be resized if it doesn't contain enough elements to report all the results. The significance of this is that no memory is allocated for the results and so garbage collection performance is improved when the check is performed frequently.

See Also: OverlapCircle, OverlapCircleAll.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文