소스 검색

slight style changes

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

+ 3 - 4
src/Materials/material.ts

@@ -661,10 +661,9 @@ export class Material implements IAnimatable {
     constructor(name: string, scene: Scene, doNotAdd?: boolean) {
         this.name = name;
         this.id = name || Tools.RandomId();
-        let idSubscript = 0;
-        while (scene.getMaterialByID(this.id) != null) {
-            idSubscript++;
-            this.id = name + " " + idSubscript;
+        let idSubscript = 1;
+        while (scene.getMaterialByID(this.id) !== null) {
+            this.id = name + " " + idSubscript++;
         }
 
         this._scene = scene || EngineStore.LastCreatedScene;