mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
42 lines
747 B
JavaScript
42 lines
747 B
JavaScript
/**
|
|
* @author mrdoob / http://mrdoob.com/
|
|
*/
|
|
|
|
Menubar.View = function (editor) {
|
|
|
|
var container = new UI.Panel();
|
|
container.setClass('menu');
|
|
|
|
var title = new UI.Panel();
|
|
title.setClass('title');
|
|
title.setTextContent('视图');
|
|
container.add(title);
|
|
|
|
var options = new UI.Panel();
|
|
options.setClass('options');
|
|
container.add(options);
|
|
|
|
// VR mode
|
|
|
|
var option = new UI.Row();
|
|
option.setClass('option');
|
|
option.setTextContent('VR模式');
|
|
option.onClick(function () {
|
|
|
|
if (WEBVR.isAvailable() === true) {
|
|
|
|
editor.signals.enterVR.dispatch();
|
|
|
|
} else {
|
|
|
|
alert('WebVR不可用');
|
|
|
|
}
|
|
|
|
});
|
|
options.add(option);
|
|
|
|
return container;
|
|
|
|
};
|