SetTriangleStrip to SetTriangles

I am using Bunny83’s code as a replacement to Unity’s LineRenderer: 1

In this code, the method SetTriangleStrip was labeled as obsolete, but still functioned in Unity4. However, I just downloaded Unity5 and this is not the case anymore. I replaced SetTriangleStrip with SetTriangles, but now I get the warning that triangles must be multiples of 3. Could someone help me update this code? Thank you!

I found a solution that works. I just had to think how strips were converted to triangles. Here’s what I changed in the end:

m_Indices = new int[(m_Points.Count*2-2)*3];
int j = 0;
		for (int i = 0; i < m_Points.Count*2-3; i+=2, j++)
			m_Indices[i*3] = j*2;
			m_Indices[i*3+1] = j*2+1;			
			m_Indices[i*3+2] = j*2+2;
			m_Indices[i*3+3] = j*2+1;
			m_Indices[i*3+4] = j*2+3;
			m_Indices[i*3+5] = j*2+2;