浏览代码

Editor: Fix drag&drop in UIOutliner.

Mugen87 5 年之前
父节点
当前提交
4c5f3ddd9e
共有 1 个文件被更改,包括 17 次插入2 次删除
  1. 17 2
      editor/js/libs/ui.three.js

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

@@ -522,8 +522,23 @@ UIOutliner.prototype.setOptions = function ( options ) {
 
 
 		} else if ( area > 0.75 ) {
 		} else if ( area > 0.75 ) {
 
 
-			var nextObject = scene.getObjectById( this.nextSibling.value );
-			moveObject( object, nextObject.parent, nextObject );
+			var nextObject, parent;
+
+			if ( this.nextSibling !== null ) {
+
+				nextObject = scene.getObjectById( this.nextSibling.value );
+				parent = nextObject.parent;
+
+			} else {
+
+				// end of list (no next object)
+
+				nextObject = null;
+				parent = scene.getObjectById( this.value ).parent;
+
+			}
+
+			moveObject( object, parent, nextObject );
 
 
 		} else {
 		} else {