소스 검색

revert to component

Trevor Baron 6 년 전
부모
커밋
d506aa643c
1개의 변경된 파일8개의 추가작업 그리고 6개의 파일을 삭제
  1. 8 6
      src/babylon.assetContainer.ts

+ 8 - 6
src/babylon.assetContainer.ts

@@ -65,9 +65,10 @@ module BABYLON {
             this.textures.forEach((o) => {
                 this.scene.addTexture(o);
             });
-            this.effectLayers.forEach((o) => {
-                this.scene.addEffectLayer(o);
-            });
+            
+            for (let component of this.scene._serializableComponents) {
+                component.addFromContainer(this);
+            }
         }
 
         /**
@@ -113,9 +114,10 @@ module BABYLON {
             this.textures.forEach((o) => {
                 this.scene.removeTexture(o);
             });
-            this.effectLayers.forEach((o) => {
-                this.scene.removeEffectLayer(o);
-            });
+            
+            for (let component of this.scene._serializableComponents) {
+                component.removeFromContainer(this);
+            }
         }
 
         private _moveAssets<T>(sourceAssets: T[], targetAssets: T[], keepAssets: T[]): void {