title: Accessing mesh vertices performance issue
body: <p>I am having trouble with this code running slow (around 250ms to execute the loop)</p>
  
  <p>The mesh.triangles.Length is 8700.</p>
  
  <p>I am using c# on the latest Unity platform (version 2018.2.3). </p>
  
  <p>I suspect this is because I am switching between two arrays for each iteration, ie. i take a value from triangle then look up the vertices element of it.</p>
  
  <p>mesh.triangles is an array of integers.
  mesh.vertices is an array of Vector3's.</p>
  
  <hr>
  
  <pre><code>while (j &lt; mesh.triangles.Length)  
  {
  
      m_Particles [currentParticlePos].position =  vertices[mesh.triangles[j]];   
  
      // allocate a particle to every 3rd vertex position.
      j = j + 3;
      currentParticlePos++;
  }
  </code></pre>
  
  <hr>