首先说明这里画的线只在编辑器里显示, 画激光有另外的方法
目录
1. DrawLine
需要两个坐标1, 坐标2, 并且写到Update方法里
Debug.DrawLine(this.transform.position, target.transform.position, Color.blue) ;
2. DrawRay
需要一个起点和一个方向
Debug.DrawRay(this.transform.position, this.transform.forward, Color.red);