Immediate Mode Draw.LineDashed(...) draws a non-dashed line

  • updated
  • Fixed

Perhaps I am missing a property, but this is pulled closely from the sample.

void OnEnable() => Camera.onPostRender += DrawShapes;

void OnDisable() => Camera.onPostRender -= DrawShapes;


void DrawShapes(Camera cam)

{

Draw.BlendMode = ShapesBlendMode.Additive;

Draw.LineGeometry = LineGeometry.Billboard;

Draw.LineThickness = 0.01f;

Draw.LineDashSize = 2f;


Draw.LineDashed(vector1, vector2, Color.yellow);
}

Reporting a bug? please specify Unity version:
2019.4.1f1
Reporting a bug? please specify Shapes version:
1.1.1 (asset store)
Pinned replies
Freya Holmér
  • Answer
  • Fixed

ah heck, typo on my end, sorry! thanks for the report! this has been fixed for the next version!
if you want a fix before the asset store update hits, open Draw.cs, line 31

replace

mat.SetFloat( ShapesMaterialUtils.propDashSize, dashed ? 0 : dashSize );

with

mat.SetFloat( ShapesMaterialUtils.propDashSize, dashed ? dashSize : 0 );
Freya Holmér
  • Answer
  • Fixed

ah heck, typo on my end, sorry! thanks for the report! this has been fixed for the next version!
if you want a fix before the asset store update hits, open Draw.cs, line 31

replace

mat.SetFloat( ShapesMaterialUtils.propDashSize, dashed ? 0 : dashSize );

with

mat.SetFloat( ShapesMaterialUtils.propDashSize, dashed ? dashSize : 0 );
andrew trese

Great support 110%