Ejemplo n.º 1
0
        public void CreateLine(ILineModel line)
        {
            GameObject currentLine = Instantiate(DrawService.GetLinePrefab(), Vector3.zero, Quaternion.identity);

            currentLine.transform.SetParent(DrawService.GetRoot3D().transform, false);
            LineRenderer lineRenderer = currentLine.GetComponent <LineRenderer>();

            lineRenderer.sharedMaterial = new Material(DrawService.GetLineMaterial());
            lineRenderer.positionCount  = line.KochLineProperty.OriginalPositions.Length;
            lineRenderer.SetPositions(line.KochLineProperty.OriginalPositions);
            line.LineGameObject = lineRenderer;
            _lines.Add(line.Guid, line);
            UpdateLine((LineModel)line);
        }