Error CS1061 'Mesh' does not contain a definition for 'GetTriangleStrip'

2

Hello, when I update my Unity 3.4 code to Unity 5.3, it shows me the following error:

  

Error CS1061 'Mesh' does not contain a definition for 'GetTriangleStrip' and       no extension method 'GetTriangleStrip' accepting a first argument of type 'Mesh'       could be found (are you missing a using directive or an assembly reference?)

The code in question is the following:

int[]  inputtriangles = combine.mesh.GetTriangleStrip(combine.subMeshIndex);
for (int i=0;i<inputtriangles.Length;i++)
{
    triangles[i+triangleOffset] = inputtriangles[i] + vertexOffset;
}
triangleOffset += inputtriangles.Length;

How can I solve it?

    
asked by Ruslan López 03.01.2016 в 01:48
source

1 answer

1

You can try the following:

Change where GetTriangleStrip(...) appears per GetTriangles(...)

int[]  inputtriangles = combine.mesh.GetTriangles(combine.subMeshIndex);

for (int i = 0; i < inputtriangles.Length; i++){

    triangles[i+triangleOffset] = inputtriangles[i] + vertexOffset;
}

triangleOffset += inputtriangles.Length;

P.D: if in some place you also use SetTriangleStrip(...) you can replace with SetTriangles(...)

link link

    
answered by 03.01.2016 / 07:07
source