Get the surface of the object in the form of a collection of Vector3

I want to get the surface of a object in the form of a collection of Vector3, how should I do it :thinking:

Mesh mesh = this.gameObject.GetComponent<MeshFilter>().sharedMesh;
Vector3[] vertices = mesh.vertices;

This works for me.

I got it. :laughing:
sharedMesh pass by reference;mesh pass by value.