protected static int GetMaterialIndex(Material m, List <TreeMaterial> materials, bool tileV) { for (int i = 0; i < materials.Count; i++) { if (materials[i].material == m) { TreeMaterial local1 = materials[i]; local1.tileV |= tileV; return(i); } } TreeMaterial item = new TreeMaterial { material = m, tileV = tileV }; materials.Add(item); return(materials.Count - 1); }
// // Used for mapping materials.. // protected static int GetMaterialIndex(Material m, List <TreeMaterial> materials, bool tileV) { for (int i = 0; i < materials.Count; i++) { if (materials[i].material == m) { // Tiling overrides non-tiling materials[i].tileV |= tileV; return(i); } } // not in list yet, add it.. TreeMaterial tm = new TreeMaterial(); tm.material = m; tm.tileV = tileV; materials.Add(tm); return(materials.Count - 1); }
protected static int GetMaterialIndex(Material m, List<TreeMaterial> materials, bool tileV) { for (int i = 0; i < materials.Count; i++) { if (materials[i].material == m) { TreeMaterial local1 = materials[i]; local1.tileV |= tileV; return i; } } TreeMaterial item = new TreeMaterial { material = m, tileV = tileV }; materials.Add(item); return (materials.Count - 1); }