Selaa lähdekoodia

Merge pull request #382 from Temechon/patch-23

Update babylon.InstancedMesh.ts
David Catuhe 10 vuotta sitten
vanhempi
commit
1e53e3d98b
1 muutettua tiedostoa jossa 5 lisäystä ja 3 poistoa
  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);
         }
     }
-} 
+}