public class TestWindow : EditorWindow {
private Material m_material;
void OnEnalbe() {
m_material = new Material(Shader.Find("Hidden/Internal-Colored"));
m_material.hideFlags = HideFlags.HideAndDontSave;
}
void OnGUI() {
var rect = new Rect(0, 0, 200, 100);
if (Event.current.type == EventType.Repaint) {
GL.PushMatrix();
material.SetPass(0);
GL.LoadPixelMatrix();
GL.Begin(GL.LINE_STRIP);
GL.Color(new Color(88.0f/255.0f, 88.0f/255.0f, 88.0f/255.0f));
GL.Vertex3(rect.x, rect.y, 0);
GL.Vertex3(rect.x + rect.width, rect.y + rect.height, 0);
GL.Vertex3(rect.x, rect.y + rect.height, 0);
GL.Vertex3(rect.x, rect.y, 0);
GL.PopMatrix();
}
}
}