void DrawLine(Vector3 a, Vector3 b, Color color) // 接口 { a = Camera.main.WorldToViewportPoint(a); b = Camera.main.WorldToViewportPoint(b); DrawLines.DoDrawLines(color, new Vector2[] { a, b }, new int[] { 0, 1 }, Matrix4x4.identity); }
void DrawLineScreen(Vector2 a, Vector2 b, Color color) { Matrix4x4 m = Matrix4x4.identity; var screenSize = new Vector2(Screen.width, Screen.height); a /= screenSize; b /= screenSize; DrawLines.DoDrawLines(color, new Vector2[] { a, b }, new int[] { 0, 1 }, m); }