Draw.Polyline not rendering in edit mode
Immediate mode Polyline isn't rendering in edit mode even when set to [ExecuteAlways].
using System.Collections;
using UnityEngine;
using Shapes;
[ExecuteAlways]
[RequireComponent(typeof(Quad))]
public class Outline : ImmediateModeShapeDrawer
{
[SerializeField] float thickness = 0.15f;
[SerializeField] Color color = Color.white;
[SerializeField] PolylineJoins joins = PolylineJoins.Miter;
private Quad quad;
public override void DrawShapes(Camera cam)
{ if (quad == null)
quad = GetComponent<Quad>();
using (Draw.Command(cam))
{
using (var p = new PolylinePath())
{
for (int i = 0; i < 4; i++)
p.AddPoint(transform.TransformPoint(quad.GetQuadVertex(i)));
//Only works in play mode
Draw.Polyline(p, true, thickness, joins, color);
//Works in edit and play modes
Draw.Line(p[0].point, p[1].point, thickness, color);
}
}
}
}
Reporting a bug? please specify Unity version:
2021.1.21f1
Reporting a bug? please specify Shapes version:
4.1.0
Reporting a bug? please specify Render Pipeline:
URP
this has now been fixed in 4.1.1