private void setupEngineModels(Transform modelBase)
 {
     engineModels = new InterstageDecouplerEngine[numberOfEngines];
     float anglePerEngine = 360f / (float)numberOfEngines;
     float startAngle = enginePlacementAngleOffset;
     Transform modelTransform;
     String fullName;
     float placementAngle;
     for (int i = 0; i < numberOfEngines; i++)
     {
         placementAngle = startAngle + ((float)i * anglePerEngine);
         fullName = modelName + "-" + i;
         modelTransform = modelBase.FindRecursive(fullName);
         if (modelTransform == null)
         {
             modelTransform = SSTUUtils.cloneModel(modelName).transform;
             modelTransform.name = fullName;
             modelTransform.gameObject.name = fullName;
         }
         modelTransform.parent = modelBase;
         engineModels[i] = new InterstageDecouplerEngine(modelTransform, placementAngle, engineRotationOffset);
     }
 }
 public static void updateModelMaterial(Transform root, string[] excludeMeshes, string[] meshes, string shader, string diffuse, string normal, string specular, string emissive, string occlusion, ShaderProperty[] props)
 {
     //black-list, do everything not specified in excludeMeshes array
     if (excludeMeshes != null && excludeMeshes.Length > 0)
     {
         //TODO
     }
     else if (meshes == null || meshes.Length <= 0)//no validation, do them all
     {
         Renderer[] rends = root.GetComponentsInChildren<Renderer>(true);
         int len = rends.Length;
         for (int i = 0; i < len; i++)
         {
             updateRenderer(rends[i], shader, diffuse, normal, specular, emissive, occlusion, props);
         }
     }
     else//white-list, only do what is specified by meshes array
     {
         int len = meshes.Length;
         Transform tr;
         Renderer r;
         for (int i = 0; i < len; i++)
         {
             tr = root.FindRecursive(meshes[i]);
             if (tr == null) { continue; }
             r = tr.GetComponent<Renderer>();
             if (r == null) { continue; }
             updateRenderer(r, shader, diffuse, normal, specular, emissive, occlusion, props);
         }
     }
 }