Ver código fonte

fix endless loop

Nicholas Barlow 4 anos atrás
pai
commit
03dddac288
1 arquivos alterados com 2 adições e 1 exclusões
  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;