浏览代码

Editor: Renamed parent() to moveObject().

Mr.doob 10 年之前
父节点
当前提交
70544e2787
共有 3 个文件被更改,包括 27 次插入29 次删除
  1. 24 26
      editor/js/Editor.js
  2. 1 1
      editor/js/Sidebar.Object3D.js
  3. 2 2
      editor/js/libs/ui.three.js

+ 24 - 26
editor/js/Editor.js

@@ -155,6 +155,30 @@ Editor.prototype = {
 
 
 	},
 	},
 
 
+	moveObject: function ( object, parent, before ) {
+
+		if ( parent === undefined ) {
+
+			parent = this.scene;
+
+		}
+
+		parent.add( object );
+
+		// sort children array
+
+		if ( before !== undefined ) {
+
+			var index = parent.children.indexOf( before );
+			parent.children.splice( index, 0, object );
+			parent.children.pop();
+
+		}
+
+		this.signals.sceneGraphChanged.dispatch();
+
+	},
+
 	nameObject: function ( object, name ) {
 	nameObject: function ( object, name ) {
 
 
 		object.name = name;
 		object.name = name;
@@ -319,32 +343,6 @@ Editor.prototype = {
 
 
 	//
 	//
 
 
-	parent: function ( object, parent, before ) {
-
-		if ( parent === undefined ) {
-
-			parent = this.scene;
-
-		}
-
-		parent.add( object );
-
-		// sort children array
-
-		if ( before !== undefined ) {
-
-			var index = parent.children.indexOf( before );
-			parent.children.splice( index, 0, object );
-			parent.children.pop();
-
-		}
-
-		this.signals.sceneGraphChanged.dispatch();
-
-	},
-
-	//
-
 	select: function ( object ) {
 	select: function ( object ) {
 
 
 		if ( this.selected === object ) return;
 		if ( this.selected === object ) return;

+ 1 - 1
editor/js/Sidebar.Object3D.js

@@ -343,7 +343,7 @@ Sidebar.Object3D = function ( editor ) {
 
 
 				if ( object.parent.id !== newParentId && object.id !== newParentId ) {
 				if ( object.parent.id !== newParentId && object.id !== newParentId ) {
 
 
-					editor.parent( object, editor.scene.getObjectById( newParentId ) );
+					editor.moveObject( object, editor.scene.getObjectById( newParentId ) );
 
 
 				}
 				}
 
 

+ 2 - 2
editor/js/libs/ui.three.js

@@ -158,12 +158,12 @@ UI.Outliner = function ( editor ) {
 
 
 			if ( item.nextSibling === null ) {
 			if ( item.nextSibling === null ) {
 
 
-				editor.parent( object, editor.scene );
+				editor.moveObject( object, editor.scene );
 
 
 			} else {
 			} else {
 
 
 				var nextObject = scene.getObjectById( item.nextSibling.value );
 				var nextObject = scene.getObjectById( item.nextSibling.value );
-				editor.parent( object, nextObject.parent, nextObject );
+				editor.moveObject( object, nextObject.parent, nextObject );
 
 
 			}
 			}