public static void DrawSolidArc(Vector3 center, Vector3 normal, Vector3 from, float angle, float radius) { if (Event.current.type != EventType.Repaint) { return; } Vector3[] array = new Vector3[60]; SetDiscSectionPoints(array, 60, center, normal, from, angle, radius); Shader.SetGlobalColor("_HandleColor", color * new Color(1f, 1f, 1f, 0.5f)); Shader.SetGlobalFloat("_HandleSize", 1f); RuntimeHandlesUtility.ApplyWireMaterial(); GL.PushMatrix(); GL.MultMatrix(matrix); GL.Begin(4); for (int i = 1; i < array.Length; i++) { GL.Color(color); GL.Vertex(center); GL.Vertex(array[i - 1]); GL.Vertex(array[i]); GL.Vertex(center); GL.Vertex(array[i]); GL.Vertex(array[i - 1]); } GL.End(); GL.PopMatrix(); }
private static bool BeginLineDrawing(Matrix4x4 matrix, bool dottedLines) { if (Event.current.type != EventType.Repaint) { return(false); } Color c = s_Color * lineTransparency; RuntimeHandlesUtility.ApplyWireMaterial(); GL.PushMatrix(); GL.MultMatrix(matrix); GL.Begin(1); GL.Color(c); return(true); }
public static void DrawSolidRectangleWithOutline(Vector3[] verts, Color faceColor, Color outlineColor) { if (Event.current.type != EventType.Repaint) { return; } RuntimeHandlesUtility.ApplyWireMaterial(); GL.PushMatrix(); GL.MultMatrix(matrix); if (faceColor.a > 0f) { Color c = faceColor * color; GL.Begin(4); for (int i = 0; i < 2; i++) { GL.Color(c); GL.Vertex(verts[i * 2]); GL.Vertex(verts[i * 2 + 1]); GL.Vertex(verts[(i * 2 + 2) % 4]); GL.Vertex(verts[i * 2]); GL.Vertex(verts[(i * 2 + 2) % 4]); GL.Vertex(verts[i * 2 + 1]); } GL.End(); } if (outlineColor.a > 0f) { Color c2 = outlineColor * color; GL.Begin(1); GL.Color(c2); for (int j = 0; j < 4; j++) { GL.Vertex(verts[j]); GL.Vertex(verts[(j + 1) % 4]); } GL.End(); } GL.PopMatrix(); }