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

Merge pull request #5216 from chrisjubb/dev

Add a button to show/hide the grid.
......@@ -36,7 +36,9 @@ var Editor = function () {
fogTypeChanged: new SIGNALS.Signal(),
fogColorChanged: new SIGNALS.Signal(),
fogParametersChanged: new SIGNALS.Signal(),
windowResize: new SIGNALS.Signal()
windowResize: new SIGNALS.Signal(),
showGridChanged: new SIGNALS.Signal()
};
......
......@@ -45,10 +45,15 @@ var Toolbar = function ( editor ) {
buttons.add( local );
buttons.add( new UI.Text( 'local' ) );
var showGrid = new UI.Checkbox().onChange( update ).setValue( true );
buttons.add( showGrid );
buttons.add( new UI.Text( 'show' ) );
function update() {
signals.snapChanged.dispatch( snap.getValue() === true ? grid.getValue() : null );
signals.spaceChanged.dispatch( local.getValue() === true ? "local" : "world" );
signals.showGridChanged.dispatch( showGrid.getValue() );
}
......
......@@ -430,6 +430,13 @@ var Viewport = function ( editor ) {
} );
signals.showGridChanged.add( function ( showGrid ) {
grid.visible = showGrid;
render();
} );
var animations = [];
signals.playAnimation.add( function ( animation ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册