浏览代码

任意界面打开gm面板

zhaoyang 2 年之前
父节点
当前提交
6146f27c80

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Controller/GameController.cs

@@ -23,6 +23,7 @@ namespace GFGGame
             SqliteController.Instance.Init(false, ResPathUtil.SQLITE_FILE_PATH);
             //全局点击效果
             ViewGlobal.CreatClickEffect();
+            ViewGlobal.AddShowGMViewEventListener();
             //获取游戏配置
             GetGameCfg();
         }

+ 27 - 2
GameClient/Assets/Game/HotUpdate/Views/ViewGlobal.cs

@@ -33,12 +33,37 @@ namespace GFGGame
             comHolder.target.SetPosition(pos.x, pos.y, 0);
         }
 
-        public void AddGMViewEventListener()
+        private static int index = 0;
+        public static void AddShowGMViewEventListener()
         {
+            if (LauncherConfig.netType == LauncherConfig.EnumNetType.LOCAL)
+            {
+                GRoot.inst.onTouchBegin.Add(OnTouchBegin);
+            }
+        }
+        private static void OnTouchBegin(EventContext context)
+        {
+            if (context.inputEvent.button == 1 || Stage.inst.touchCount == 2)
+            {
 
+                if (index == 0)
+                {
+                    Timers.inst.Add(1, 1, OnTimeComplete);
+                }
+                index++;
+                if (index == 2)
+                {
+                    ShowGmView();
+                }
+            }
+
+        }
+        private static void OnTimeComplete(object param)
+        {
+            index = 0;
         }
 
-        public void ShowGmView()
+        public static void ShowGmView()
         {
             ViewManager.Show(ViewName.GM_PANEL_VIEW);
         }