public void SetVertexCount(int size) { if (_lineRenderer == null) { Awake(); } if (_points.Count == size) { return; } _lineRenderer.SetVertexCount(size); while (_points.Count > size) { _points.RemoveAt(size - 1); } while (_points.Count < size) { _points.Add(Vector3.zero); } _points.Trim(); }