Search Unity

Unity 5 API fail to upgrade please help

Discussion in 'Scripting' started by Berir, May 11, 2015.

  1. Berir

    Berir

    Joined:
    Mar 23, 2013
    Posts:
    55
    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
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. public class MeshCombineUtility {
    4.    
    5.      public struct MeshInstance
    6.      {
    7.          public Mesh      mesh;
    8.          public int       subMeshIndex;          
    9.          public Matrix4x4 transform;
    10.      }
    11.    
    12.      public static Mesh Combine (MeshInstance[] combines, bool generateStrips)
    13.      {
    14.          int vertexCount = 0;
    15.          int triangleCount = 0;
    16.          int stripCount = 0;
    17.          foreach( MeshInstance combine in combines )
    18.          {
    19.              if (combine.mesh)
    20.              {
    21.                  vertexCount += combine.mesh.vertexCount;
    22.                
    23.                  if (generateStrips)
    24.                  {
    25.                      // SUBOPTIMAL FOR PERFORMANCE
    26.                      int curStripCount = combine.mesh.GetTriangleStrip(combine.subMeshIndex).Length;
    27.                      if (curStripCount != 0)
    28.                      {
    29.                          if( stripCount != 0 )
    30.                          {
    31.                              if ((stripCount & 1) == 1 )
    32.                                  stripCount += 3;
    33.                              else
    34.                                  stripCount += 2;
    35.                          }
    36.                          stripCount += curStripCount;
    37.                      }
    38.                      else
    39.                      {
    40.                          generateStrips = false;
    41.                      }
    42.                  }
    43.              }
    44.          }
     
  2. steego

    steego

    Joined:
    Jul 15, 2010
    Posts:
    969