Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.57 KB | None | 0 0
  1. public static void DrawLine(Vector2 pointA, Vector2 pointB, Color color)
  2. {
  3.     if (Canvas.lineMaterial == null)
  4.     {
  5.         Canvas.lineMaterial = new Material("Shader \"Lines/Colored Blended\" {SubShader { Pass {   BindChannels { Bind \"Color\",color }   Blend SrcAlpha OneMinusSrcAlpha   ZWrite Off Cull Off Fog { Mode Off }} } }");
  6.         Canvas.lineMaterial.set_hideFlags(13);
  7.         Canvas.lineMaterial.get_shader().set_hideFlags(13);
  8.     }
  9.     Canvas.lineMaterial.SetPass(0);
  10.     GL.Begin(1);
  11.     GL.Color(color);
  12.     GL.Vertex3(pointA.x, pointA.y, 0f);
  13.     GL.Vertex3(pointB.x, pointB.y, 0f);
  14.     GL.End();
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement