Hello!
I am quite experienced in plain c# but not in unity. I don’t understand a line in this code (from http://unity3d.com/support/documentation/ScriptReference/Mesh-vertices.html):
function Update () {
var mesh : Mesh = GetComponent(MeshFilter).mesh;
var vertices : Vector3[] = mesh.vertices;
for (var i = 0; i < vertices.Length; i++)
vertices _+= Vector3.up * Time.deltaTime;_
mesh.vertices = vertices;
mesh.RecalculateBounds();
}
Why has the vertices array to be assigned back to mesh.vertices? Is not the vertices a plain reference to mesh.vertices? I’m afraid I’m missing an important point here, could anyone help please?