Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void DrawLine(Vector2 pointA, Vector2 pointB, Color color)
- {
- if (Canvas.lineMaterial == null)
- {
- Canvas.lineMaterial = new Material("Shader \"Lines/Colored Blended\" {SubShader { Pass { BindChannels { Bind \"Color\",color } Blend SrcAlpha OneMinusSrcAlpha ZWrite Off Cull Off Fog { Mode Off }} } }");
- Canvas.lineMaterial.set_hideFlags(13);
- Canvas.lineMaterial.get_shader().set_hideFlags(13);
- }
- Canvas.lineMaterial.SetPass(0);
- GL.Begin(1);
- GL.Color(color);
- GL.Vertex3(pointA.x, pointA.y, 0f);
- GL.Vertex3(pointB.x, pointB.y, 0f);
- GL.End();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement