Explorar o código

Merge pull request #6064 from TrevorDev/assetContainerDontOverride

no not overwrite scene environment texture with null
David Catuhe %!s(int64=6) %!d(string=hai) anos
pai
achega
1948e9d0de
Modificáronse 2 ficheiros con 4 adicións e 2 borrados
  1. 1 1
      dist/preview release/what's new.md
  2. 3 1
      src/assetContainer.ts

+ 1 - 1
dist/preview release/what's new.md

@@ -205,7 +205,7 @@
 - Tools.CreateScreenshot stopped working ([TrevorDev](https://github.com/TrevorDev))
 - Inspector showing duplicate nodes when attached to gizmo ([TrevorDev](https://github.com/TrevorDev))
 - Add missing dependencies for files to support including them from a direct path (eg. import "@babylonjs/core/Helpers/sceneHelpers";) ([TrevorDev](https://github.com/TrevorDev))
-- AssetContainer should not dispose objects it doesn't contain, Support for environmentTexture ([TrevorDev](https://github.com/TrevorDev))
+- AssetContainer should not dispose objects it doesn't contain. Support for environmentTexture add/remove ([TrevorDev](https://github.com/TrevorDev))
 - Fix `mesh.visibility` not working properly when certain material properties are set that changes the interpretation of alpha (e.g. refraction, specular over alpha, etc.) ([bghgary](https://github.com/bghgary))
 - Fix material and texture leak when loading/removing GLTF with AssetContainer ([TrevorDev](https://github.com/TrevorDev))
 

+ 3 - 1
src/assetContainer.ts

@@ -78,7 +78,9 @@ export class AssetContainer extends AbstractScene {
             this.scene.addReflectionProbe(o);
         });
 
-        this.scene.environmentTexture = this.environmentTexture;
+        if (this.environmentTexture) {
+            this.scene.environmentTexture = this.environmentTexture;
+        }
 
         for (let component of this.scene._serializableComponents) {
             component.addFromContainer(this);