Forráskód Böngészése

Update babylon.InstancedMesh.ts

Added a fix when a source mesh has no submesh
Temechon 10 éve
szülő
commit
5c2e50857c
1 módosított fájl, 5 hozzáadás és 3 törlés
  1. 5 3
      Babylon/Mesh/babylon.InstancedMesh.ts

+ 5 - 3
Babylon/Mesh/babylon.InstancedMesh.ts

@@ -102,8 +102,10 @@
 
         public _syncSubMeshes(): void {
             this.releaseSubMeshes();
-            for (var index = 0; index < this._sourceMesh.subMeshes.length; index++) {
-                this._sourceMesh.subMeshes[index].clone(this, this._sourceMesh);
+            if (this._sourceMesh.subMeshes) {
+                for (var index = 0; index < this._sourceMesh.subMeshes.length; index++) {
+                    this._sourceMesh.subMeshes[index].clone(this, this._sourceMesh);
+                }
             }
         }
 
@@ -152,4 +154,4 @@
             super.dispose(doNotRecurse);
         }
     }
-} 
+}