private void OnPostRender() { pos = transform.position + transform.forward * 10 + transform.up * 5 + transform.right * 7; shapesMaterial.SetPass(0); Graphics.DrawMeshNow(GLDraw.CreateArrow(Color.red, 1), pos, Quaternion.Euler(90, 0, 0)); GL.Begin(GL.LINES); GL.Color(Color.red); GL.Vertex(pos); GL.Vertex(pos - Vector3.forward * 1); GL.End(); }
public Resources(Color selectedColor) { lineMat = new Material(Shader.Find("RunTimeHandles/VertexColor")); lineMat.color = Color.white; quadeMat = new Material(Shader.Find("RunTimeHandles/VertexColor")); quadeMat.color = Color.white; shapMatRed = new Material(Shader.Find("RunTimeHandles/VertexColor")); shapMatRed.color = Color.red; shapMatBlue = new Material(Shader.Find("RunTimeHandles/VertexColor")); shapMatBlue.color = Color.blue; shapMatGreen = new Material(Shader.Find("RunTimeHandles/VertexColor")); shapMatGreen.color = Color.green; shapMatSelected = new Material(Shader.Find("RunTimeHandles/VertexColor")); shapMatSelected.color = selectedColor; arrowMesh = GLDraw.CreateArrow(Color.white, 1); cubeMesh = GLDraw.CreateCube(Color.white, Vector3.zero, 1); }