Add a new MultiPolyline Component Shape

Avatar

It would be great to have MultiPolyline Component Shape that would enable drawing multiple polylines in a single draw call.

It would work exactly like the excellent Polyline Component, but would let you input multiple list of points.

This would be very helpful for large networks of polylines (think hundreds of polylines with thousands of points each).


Note: it is possible to emulate this feature in a hacky way right now:

  • starting with list of Points A and list of Points B
  • create a new list of Points C and add to it the points of A
  • Add a new points to C corresponding to the position of the last point of A but with transparent color and zero width
  • Add a new points to C corresponding to the first point of B but with transparent color and zero width
  • Add all the points of B to C
  • Create a Polyline using the Points of C

Unfortunately the hacky way requires a lot of copying points for large networks that could probably be avoided with a MultiPolyline Component, which could also do other optimizations when creating its buffers.

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline: