protected virtual void OnRenderObject() { if (!CanRender) { return; } var cam = Camera.current; var view = cam.worldToCameraMatrix; var layerToWorld = layer.LayerToWorld.Matrix; var worldCenter = layerToWorld.MultiplyPoint3x4(Vector3.zero); var width = Mathf.Min( debugLineWidth * cam.GetHandleSize(worldCenter), 0.8f * borderThickness); var c = debugColor; gl.CurrentColor = c; gl.DrawQuad(view * layerToWorld * innerBounds.Model, width); gl.CurrentColor = 0.5f * c; gl.DrawQuad(view * layerToWorld * outerBounds.Model, width); if (debugFill) { gl.CurrentColor = 0.5f * c; gl.FillQuad(view * layerToWorld * innerBounds.Model); } }
public void DrawQuad(GLFigure f) { if ((renderType & Data.RenderTypeEnum.Fill) != 0) { f.FillQuad(target.position, Camera.main.transform.rotation, size, bodyColor); } if ((renderType & Data.RenderTypeEnum.Line) != 0) { f.DrawQuad(target.position, Camera.main.transform.rotation, size, lineColor); } }
private void OnRenderObject() { if (!debugMode) { return; } if (fig == null) { return; } validator.Validate(); var q = field.transform.rotation; var s = 0.1f * Vector2.one; var c = debugPosColor; for (var i = 0; i < fpositions.Count; i++) { var pos = fpositions[i]; fig.DrawQuad(pos, q, s, c); } }