소스 검색

fix endless loop

Nicholas Barlow 4 년 전
부모
커밋
03dddac288
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      src/Materials/material.ts

+ 2 - 1
src/Materials/material.ts

@@ -663,7 +663,8 @@ export class Material implements IAnimatable {
         this.id = name || Tools.RandomId();
         let idSubscript = 0;
         while (scene.getMaterialByID(this.id) != null) {
-            this.id = name + "_" + idSubscript;
+            idSubscript++;
+            this.id = name + " " + idSubscript;
         }
 
         this._scene = scene || EngineStore.LastCreatedScene;