07-07-2023, 03:24 AM
(07-06-2023, 10:26 AM)_Aka_ Wrote: Hi
CurvyLineRenderer is a class that synchronises a Curvy Spline with a Unity's LineRenderer. The display is defined by the LineRenderer. So to have a dotted line with a CurvyLineRenderer, you need to configure the LineRenderer to display a dotted line. Surely you can find this information online, on Unity's forums and whatnot. I guess this is doable by setting a dotted material to the LineRenderer.
I hope this helped.
Have a nice day
Thank you for your reply。
Suppose I have a line segment of 10 points drawn on the screen using CurvyLineRenderer, and I want to set it dynamically at run time for example 1-4 points connected by line segment 1, 5-10 points connected by line segment 2, and after I trigger some condition become 1-5 connected by line segment 1 and 6-10 connected by line segment 2.
I now the idea is to get a point in the whole period of the percentage of the line segment, and then through curvySpline. GetPositionsCache () to get the result of multiply this percentage, then the results will be assigned to LineRenderer to draw. How do I get this percentage? Or do you have a better way to do it?