Search Unity

Shutting off CombineInstance to get interaction

Discussion in 'Scripting' started by roach_779, Jan 5, 2014.

  1. roach_779

    roach_779

    Joined:
    Aug 2, 2012
    Posts:
    37
    I'm working on an interactive book and I got a script that creates page flip (not curl), but it also convert pages into combined instance. Is removing combine instance will allow me to add interaction to the pages? Removing combine instance is as easy as commenting out lines?

    Code (csharp):
    1.  MeshFilter[] meshFilters = GetComponentsInChildren<MeshFilter>(true);
    2.         CombineInstance[] combine = new CombineInstance[meshFilters.Length];
    3.         int i = 0;
    4.         List<Material> mat = new List<Material>();
    5.  
    6.         while (i < meshFilters.Length)
    7.         {
    8.             combine[i].mesh = meshFilters[i].sharedMesh;
    9.             combine[i].transform = meshFilters[i].transform.localToWorldMatrix;
    10.             meshFilters[i].gameObject.active = false;
    11.  
    12.             mat.Add(meshFilters[i].renderer.material)

    Thanks
     
  2. roach_779

    roach_779

    Joined:
    Aug 2, 2012
    Posts:
    37
    Anybody?