lvjincheng 2 年 前
コミット
201a12f657
1 ファイル変更15 行追加1 行削除
  1. 15 1
      Assets/BowArrow/Scripts/Expand/PersistenHandler.cs

+ 15 - 1
Assets/BowArrow/Scripts/Expand/PersistenHandler.cs

@@ -1,6 +1,7 @@
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
+using UnityEngine.UI;
 using UnityEngine.SceneManagement;
 
 //持久化的处理脚本,在app启动时就应开始常驻
@@ -27,7 +28,20 @@ public class MenuBackController {
     long lastPressExitTime = 0;
     public void Update()
     {
-        if (Input.GetKeyDown(KeyCode.Escape)) HandleKeyDownEscape();
+        if (Input.GetKeyDown(KeyCode.Escape) || CommonConfig.StandaloneMode && Input.GetKeyDown(KeyCode.Space))
+        {
+            HandleKeyDownEscape();
+        }
+        if (CommonConfig.StandaloneMode)
+        {
+            //暴力取消导航
+            foreach (var item in Object.FindObjectsOfType<Button>())
+            {
+                var nv = item.navigation;
+                nv.mode = Navigation.Mode.None;
+                item.navigation = nv;
+            }
+        }
     }
     public void HandleKeyDownEscape()
     {