Ver código fonte

files, extensions or root

Ben Adams 7 anos atrás
pai
commit
824e27e603
1 arquivos alterados com 7 adições e 8 exclusões
  1. 7 8
      src/Materials/Textures/babylon.cubeTexture.ts

+ 7 - 8
src/Materials/Textures/babylon.cubeTexture.ts

@@ -44,22 +44,21 @@
             const extension = forcedExtension ? forcedExtension : (lastDot > -1 ? rootUrl.substring(lastDot).toLowerCase() : "");
             const extension = forcedExtension ? forcedExtension : (lastDot > -1 ? rootUrl.substring(lastDot).toLowerCase() : "");
             const isDDS = (extension === ".dds");
             const isDDS = (extension === ".dds");
 
 
-            if (!isDDS && !files) {
-                if (!extensions) {
+            if (!files) {
+                if (!isDDS && !extensions) {
                     extensions = ["_px.jpg", "_py.jpg", "_pz.jpg", "_nx.jpg", "_ny.jpg", "_nz.jpg"];
                     extensions = ["_px.jpg", "_py.jpg", "_pz.jpg", "_nx.jpg", "_ny.jpg", "_nz.jpg"];
                 }
                 }
 
 
                 files = [];
                 files = [];
 
 
-                for (var index = 0; index < extensions.length; index++) {
-                    files.push(rootUrl + extensions[index]);
+                if (extensions) {
+                    
+                    for (var index = 0; index < extensions.length; index++) {
+                        files.push(rootUrl + extensions[index]);
+                    }
                 }
                 }
-
-                this._extensions = extensions;
             }
             }
 
 
-            this._files = files ? files : [];
-
             if (!this._texture) {
             if (!this._texture) {
                 if (!scene.useDelayedTextureLoading) {
                 if (!scene.useDelayedTextureLoading) {
                     if (prefiltered) {
                     if (prefiltered) {