浏览代码

CmdAddObject simplified

Daniel 10 年之前
父节点
当前提交
91161bf49a
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      editor/js/CmdAddObject.js

+ 2 - 4
editor/js/CmdAddObject.js

@@ -23,15 +23,13 @@ CmdAddObject = function ( object ) {
 
 		if ( object.geometry !== undefined ) {
 
-			this.objectJSON.geometries = [];
-			this.objectJSON.geometries.push( object.geometry.toJSON( meta ) );
+			this.objectJSON.geometries = [ object.geometry.toJSON( meta ) ];
 
 		}
 
 		if ( object.material !== undefined ) {
 
-			this.objectJSON.materials = [];
-			this.objectJSON.materials.push( object.material.toJSON( meta ) );
+			this.objectJSON.materials = [ object.material.toJSON( meta ) ];
 
 		}