RaycastHit2D

struct in UnityEngine

Switch to Manual

Description

在 2D 物理中,有关射线投射检测到的对象的返回信息。

A raycast is used to detect objects that lie along the path of a ray and is conceptually like firing a laser beam into the Scene and observing which objects are hit by it. The RaycastHit2D class is used by Physics2D.Raycast and other functions to return information about the objects detected by raycasts.

另请参阅:Physics2D.RaycastRay2D 类。

Variables

centroid用于执行投射的图元的质心。
collider射线命中的碰撞体。
distance从射线原点到撞击点的距离。
fraction射线上发生命中的距离的分数。
normal射线命中的表面的法线矢量。
point世界空间中射线命中碰撞体表面的点。
rigidbody附加到命中的对象的 Rigidbody2D。
transform命中的对象的变换。