예제 #1
0
 public IEnumerator LoadMaterials(glTF gltf)
 {
     // using (MeasureTime("LoadMaterials"))
     {
         if (gltf.materials == null || !gltf.materials.Any())
         {
             AddMaterial(MaterialImporter(0, null, false));
         }
         else
         {
             for (int i = 0; i < gltf.materials.Count; ++i)
             {
                 AddMaterial(MaterialImporter(i, gltf.materials[i], gltf.MaterialHasVertexColor(i)));
             }
         }
     }
     yield return(null);
 }
예제 #2
0
 IEnumerator LoadMaterials()
 {
     using (MeasureTime("LoadMaterials"))
     {
         if (GLTF.materials == null || !GLTF.materials.Any())
         {
             AddMaterial(MaterialImporter.CreateMaterial(0, null, false));
         }
         else
         {
             for (int i = 0; i < GLTF.materials.Count; ++i)
             {
                 AddMaterial(MaterialImporter.CreateMaterial(i, GLTF.materials[i], GLTF.MaterialHasVertexColor(i)));
             }
         }
     }
     yield return(null);
 }