提交 b9f0c866 编写于 作者: M Mr.doob

Editor/App: Passing scene to scripts.

上级 1444baed
......@@ -41,7 +41,7 @@ var APP = {
var script = sources[ i ];
script.compiled = new Function( 'event', script.source ).bind( object );
script.compiled = new Function( 'scene', 'event', script.source ).bind( object );
scripts[ script.event ].push( script.compiled );
......@@ -68,7 +68,7 @@ var APP = {
for ( var i = 0, l = array.length; i < l; i ++ ) {
array[ i ]( event );
array[ i ]( scene, event );
}
......
......@@ -29,7 +29,7 @@ UI.ScriptEditor = function () {
try {
( new Function( 'event', source ).bind( object.clone() ) )( {} );
( new Function( 'scene', 'event', source ).bind( object.clone() ) )( new THREE.Scene(), {} );
textarea.dom.classList.add( 'success' );
textarea.dom.classList.remove( 'fail' );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册