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

Avatar
  • 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)
Reporting a bug? please specify Render Pipeline:
Pinned replies
Avatar
Freya Holmér creator
  • 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 );
Avatar
andrew trese

Great support 110%

Avatar
Freya Holmér creator
  • 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 );