📜  raycast unity - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:58.380000             🧑  作者: Mango

代码示例3
RaycastHit hit;
/*
(Vector3) hit.point - the point where the ray has collided.
(Quaternion) hit.normal - the normal of the GameObject the ray has collided.
(float) hit.distance - the distance between the ray origin and hit.point.
(Transform) hit.transform - the transform of the GameObject the ray has hit
(Rigidbody) hit.rigidbody - rigidbody attached to GameObject ray collided,
                            if no rigidbody is attached, value is null.
(Vector2) hit.textureCoord - the coordinate of the point on the texture
                             of the GameObject the ray collided.
*/