Explorar el Código

Refactored changes

LebedenkoN hace 8 años
padre
commit
dfd49ae989
Se han modificado 1 ficheros con 4 adiciones y 5 borrados
  1. 4 5
      src/loaders/ObjectLoader.js

+ 4 - 5
src/loaders/ObjectLoader.js

@@ -764,11 +764,10 @@ Object.assign( ObjectLoader.prototype, {
 			if ( data.userData !== undefined ) object.userData = data.userData;
 
 			if ( data.children !== undefined ) {
-
-				var that = this;
-				data.children.forEach(function(index, child){
-					object.add( that.parseObject( data.children[ child ], geometries, materials ) );
-				});
+				
+				data.children.forEach(function(child){
+					object.add( this.parseObject( data.children[ child ], geometries, materials ) );
+				}, this);
 
 			}