public static VectorLine SetRay (Color color, float time, Vector3 origin, Vector3 direction) { var line = new VectorLine("SetRay", new Vector3[] {origin, new Ray(origin, direction).GetPoint (direction.magnitude)}, null, 1.0f, LineType.Continuous, Joins.None); line.color = color; if (time > 0.0f) { lineManager.DisableLine(line, time); } line.Draw(); return line; }
public static VectorLine SetLine (Color color, float time, params Vector3[] points) { if (points.Length < 2) { Debug.LogError ("VectorLine.SetLine needs at least two points"); return null; } var line = new VectorLine("SetLine", points, null, 1.0f, LineType.Continuous, Joins.None); line.color = color; if (time > 0.0f) { lineManager.DisableLine(line, time); } line.Draw(); return line; }