Ejemplo n.º 1
0
    private void ComputeLine()
    {
        Vector3[] points = new Vector3[segmentsCount + 1];
        for (int i = 0; i < segmentsCount; i++)
        {
            Vector2 localPoint = orbitHandler.Evaluate((float)i / (float)segmentsCount);
            points[i] = transform.TransformPoint(localPoint);
        }
        points[segmentsCount] = points[0];

        lineRenderer.positionCount = segmentsCount + 1;
        lineRenderer.SetPositions(points);
        lineRenderer.widthMultiplier = mainCamera.orthographicSize / 50;
    }