瀏覽代碼

3dModeling buildingCreate.js 吉超博 commit at 2021-03-04

吉超博 4 年之前
父節點
當前提交
63f550dcb7
共有 1 個文件被更改,包括 32 次插入0 次删除
  1. 32 0
      3dModeling/sgec115/buildingCreate.js

+ 32 - 0
3dModeling/sgec115/buildingCreate.js

@@ -414,3 +414,35 @@ function registerEvent() {
     })
     // 场景添加键盘按下事件,当进入第一人称行走时,按下esc键退出第一人称行走
     app.on(THING.EventType.KeyDown, function (ev) {
+        if (ev.code == 'Escape') {
+            if (box != null) {
+                app.resumeEvent(THING.EventType.DBLClick, '*', THING.EventTag.LevelEnterOperation);
+                app.resumeEvent(THING.EventType.Click, '*', THING.EventTag.LevelBackOperation);
+                box.destroy();
+                box = null;
+                $('#moveByFps').removeClass('active');
+                restarRotate();
+            }
+            if (fpsCtrl != null) {
+                exitFps();
+                restarRotate();
+            }
+            checkBtnActives(['#mapBg', '#sceneSetting']);
+        }
+    });
+    window.onresize = function () {
+        if (!checkFull()) {
+            //要执行的动作
+            if (fullScreenState == true) {
+                $('.btn-full-screen').css('display', 'block');
+                $('.btn-narrow').css('display', 'none');
+                $('#fullScreen span').text('全屏');
+                fullScreenState = false;
+            }
+        }
+    }
+}
+
+
+//====设备闪烁提示====
+function flash(objArray) {