UnityEditor.AudioMixerDrawUtils.DrawConnection C# (CSharp) Method

DrawConnection() public static method

public static DrawConnection ( Color col, float mixLevel, float srcX, float srcY, float dstX, float dstY, float width ) : void
col Color
mixLevel float
srcX float
srcY float
dstX float
dstY float
width float
return void
        public static void DrawConnection(Color col, float mixLevel, float srcX, float srcY, float dstX, float dstY, float width)
        {
            if (Event.current.type == EventType.Repaint)
            {
                Vector3[] vectorArray;
                HandleUtility.ApplyWireMaterial();
                float num = dstX - srcX;
                float num2 = dstY - srcY;
                float num3 = width / Mathf.Sqrt((num * num) + (num2 * num2));
                num *= num3;
                num2 *= num3;
                float num4 = 2f;
                float num5 = 1.2f;
                vectorArray = new Vector3[] { new Vector3(dstX, dstY), new Vector3((dstX - (num4 * num)) + (num5 * num2), (dstY - (num4 * num2)) - (num5 * num)), new Vector3((dstX - (num4 * num)) - (num5 * num2), (dstY - (num4 * num2)) + (num5 * num)), vectorArray[0] };
                Color color = new Color(col.r, col.g, col.b, (mixLevel * 0.3f) + 0.3f);
                Shader.SetGlobalColor("_HandleColor", color);
                GL.Begin(4);
                GL.Color(color);
                GL.Vertex(vectorArray[0]);
                GL.Vertex(vectorArray[1]);
                GL.Vertex(vectorArray[2]);
                GL.End();
                Color[] colors = new Color[] { color, color, color, color };
                Handles.DrawAAPolyLine(width, colors, vectorArray);
                Color[] colorArray2 = new Color[] { new Color(col.r, col.g, col.b, mixLevel), new Color(col.r, col.g, col.b, mixLevel) };
                Vector3[] points = new Vector3[] { new Vector3(srcX, srcY, 0f), new Vector3(dstX, dstY, 0f) };
                Handles.DrawAAPolyLine(width, colorArray2, points);
            }
        }