提交 8342d027 编写于 作者: G Garrett Johnson

share event objects

上级 f36920a6
......@@ -17,6 +17,8 @@ import { TrianglesDrawMode } from '../constants.js';
*/
var object3DId = 0;
var addedEvent = { type: 'added' };
var removedEvent = { type: 'removed' };
function Object3D() {
......@@ -391,7 +393,7 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
object.parent = this;
this.children.push( object );
object.dispatchEvent( { type: 'added' } );
object.dispatchEvent( addedEvent );
} else {
......@@ -424,7 +426,7 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
object.parent = null;
this.children.splice( index, 1 );
object.dispatchEvent( { type: 'removed' } );
object.dispatchEvent( removedEvent );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册