- Home /
How to render GL.Line in front of UI canvas?
GL.PushMatrix();
GL.LoadPixelMatrix();
//GL.LoadOrtho();
GL.Begin(GL.LINES);
for (int i = 0; i < origins.ToArray().Length; i++)
{
if (origins[i] && ends[i])
{
GL.Color(Color.black);
GL.Vertex(origins[i].transform.position);
GL.Color(Color.black);
GL.Vertex(ends[i].transform.position);
}
}
GL.End();
GL.PopMatrix();
This is the core code in my class, I want to render a line between two images which attach to a canvas, Indeed the line can been rendered in game, but it's always hiden by canvas, Is there anyway to let the line render in front of the canvas? By the way, my canvas's render mode is Screen Space - Overlay.
Comment