Why does the following code not work?
public float ThetaScale = 0.0001f;
private int Size;
private LineRenderer LineDrawer;
private float Theta = 0f;
void Start ()
{
LineDrawer = GetComponent<LineRenderer>();
LineDrawer.SetWidth(0.1f, 0.1f);
LineDrawer.material = new Material(Shader.Find("Mobile/Particles/Additive"));
LineDrawer.SetColors(Color.blue, Color.blue);
}
void DrawingCircle(float radius)
{
Theta = 0f;
Size = (int)((1f / ThetaScale) + 1f);
LineDrawer.SetVertexCount(Size);
for(int i = 0; i < Size; i++){
Theta += (2.0f * Mathf.PI * ThetaScale);
float x = radius * Mathf.Cos(Theta);
float y = radius * Mathf.Sin(Theta);
LineDrawer.SetPosition(i, new Vector3(x, y, 0));
}}
void Update ()
{
for(int l = 0; l < 3; l++)
{
DrawingCircle(l);
}
}
I want to plot a multiple circles like that
What's a good way to draw multiple circles?