Ok, so my game has some drawing elements in it and currently I can draw one line at a time using the Unity’s Line Renderer but I want to be able to draw multiple separate lines that are stored. I am most probably being stupid but I cant get my mind around what syntax to use or if it is even possible to declare a collection of this type.
Save your self a lot of trouble and get Vectrosity from the Asset Store
But if you must, the docs say that each separate line is on a separate game object. So create an array of GameObjects and assign to that array your LineRenderer objects.
As a public variable:
var lines : LineRenderer[];
Declaring an array inside a function:
var lines = new LineRenderer[numberOfLines];
You could use an array of GameObjects and get the LineRenderer component for each one, but it would be more efficient to store the LineRenderer in the array directly.