浏览代码

Merge pull request #382 from Temechon/patch-23

Update babylon.InstancedMesh.ts
David Catuhe 10 年之前
父节点
当前提交
1e53e3d98b
共有 1 个文件被更改,包括 5 次插入3 次删除
  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);
         }
     }
-} 
+}