Unity 5 API fail to upgrade please help

Hey Guys,

I have upgraded my project to unity 5 and now i cant get it working, i have no idea what is wrong… can someone please help me …

this is the error message i am receiving

Assets/Standard Assets/Scripts/Utility Scripts/MeshCombineUtility.cs(27,74): error CS1061: Type UnityEngine.Mesh’ does not contain a definition for GetTriangleStrip’ and no extension method GetTriangleStrip’ of type UnityEngine.Mesh’ could be found (are you missing a using directive or an assembly reference?)

and this is the line that is giving me an error ;

int curStripCount = combine.mesh.GetTriangleStrip(combine.subMeshIndex).Length;

and below is first half of the script ; I apprecieate any help or advice

thanks in advance

Barry

using UnityEngine;
using System.Collections;
public class MeshCombineUtility {
    
     public struct MeshInstance
     {
         public Mesh      mesh;
         public int       subMeshIndex;           
         public Matrix4x4 transform;
     }
    
     public static Mesh Combine (MeshInstance[] combines, bool generateStrips)
     {
         int vertexCount = 0;
         int triangleCount = 0;
         int stripCount = 0;
         foreach( MeshInstance combine in combines )
         {
             if (combine.mesh)
             {
                 vertexCount += combine.mesh.vertexCount;
                
                 if (generateStrips)
                 {
                     // SUBOPTIMAL FOR PERFORMANCE
                     int curStripCount = combine.mesh.GetTriangleStrip(combine.subMeshIndex).Length;
                     if (curStripCount != 0)
                     {
                         if( stripCount != 0 )
                         {
                             if ((stripCount & 1) == 1 )
                                 stripCount += 3;
                             else
                                 stripCount += 2;
                         }
                         stripCount += curStripCount;
                     }
                     else
                     {
                         generateStrips = false;
                     }
                 }
             }
         }

First result from google: UnityEngine.Mesh.GetTriangleStrip(int)' is obsolete: - Unity Engine - Unity Discussions

1 Like