unity line renderer position count

C#
int AmountPositions;
AmountPositions = GetComponent<LineRenderer>().positionCount;
Source

Also in C#: