void UpdateLine(Line line, int index) { lineMan.currentLineBeingDrawn = currentLine; Vector3[] listArr = new Vector3[line.lineRenderer.positionCount]; line.lineRenderer.GetPositions(listArr); // Add position to the line renderer List <Vector3> listPos = new List <Vector3>(listArr); if (!listPos.Contains(transform.position)) { lineMan.AddPointToLine(transform.position); } // Update line's couplers line.AddCoupler(GetComponent <LineCoupler>(), index); }