unity Debug.DrawLine画线
C# => public static void DrawLine(Vector3 start, Vector3 end, Color color = Color.white, float duration = 0.0f, bool depthTest = true);
在指定的起点与终点之间画条线。
参数 | 解释 |
---|---|
start | 世界空间中线条应该开始的点 |
end | 世界空间中线条应该结束的点 |
color | 线条颜色 |
duration | 线条可持续显示时间(以秒为单位) |
depthTest | 线是否应该被靠近相机的物体遮挡? |
void Update () {
//返回一条射线从摄像机通过一个屏幕点
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition)</