UnityEditor.TimeArea.DrawVerticalLine C# (CSharp) Method

DrawVerticalLine() public static method

public static DrawVerticalLine ( float x, float minY, float maxY, Color color ) : void
x float
minY float
maxY float
color Color
return void
        public static void DrawVerticalLine(float x, float minY, float maxY, Color color)
        {
            if (Event.current.type == EventType.Repaint)
            {
                HandleUtility.ApplyWireMaterial();
                if (Application.platform == RuntimePlatform.WindowsEditor)
                {
                    GL.Begin(7);
                }
                else
                {
                    GL.Begin(1);
                }
                DrawVerticalLineFast(x, minY, maxY, color);
                GL.End();
            }
        }

Usage Example

示例#1
0
 public static void DrawPlayhead(float x, float yMin, float yMax, float thickness, float alpha)
 {
     if (Event.current.type == EventType.Repaint)
     {
         TimeArea.InitStyles();
         float num   = thickness * 0.5f;
         Color color = TimeArea.styles.playhead.normal.textColor.AlphaMultiplied(alpha);
         if (thickness > 1f)
         {
             Rect rect = Rect.MinMaxRect(x - num, yMin, x + num, yMax);
             EditorGUI.DrawRect(rect, color);
         }
         else
         {
             TimeArea.DrawVerticalLine(x, yMin, yMax, color);
         }
     }
 }