zhaoyang 2 年之前
父节点
当前提交
65dd701376

+ 42 - 0
GameClient/Assets/Game/HotUpdate/Controller/GMController.cs

@@ -1,5 +1,6 @@
 using System;
 using ET;
+using FairyGUI;
 
 namespace GFGGame
 {
@@ -45,5 +46,46 @@ namespace GFGGame
             PromptController.Instance.ShowFloatTextPrompt(messageSuc, MessageType.SUCCESS);
             return true;
         }
+
+
+        private static int index = 0;
+        public static void AddShowGMViewEventListener()
+        {
+            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 static void ShowGmView()
+        {
+            if (ViewManager.isViewOpen(typeof(PhotographView).FullName)) return;
+            if (GameConfig.showGM >= 1)
+            {
+                ViewManager.Show(ViewName.GM_PANEL_VIEW);
+            }
+            else
+            {
+                ViewManager.Show(ViewName.LOG_VIEW);
+            }
+        }
     }
 }

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

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

+ 1 - 8
GameClient/Assets/Game/HotUpdate/Views/RoleInfo/RoleInfoView.cs

@@ -152,14 +152,7 @@ namespace GFGGame
 
         private void OnClickBtnHelp()
         {
-            if (GameConfig.showGM >= 1)
-            {
-                ViewManager.Show(ViewName.GM_PANEL_VIEW);
-            }
-            else
-            {
-                ViewManager.Show(ViewName.LOG_VIEW);
-            }
+            GMController.ShowGmView();
         }
 
         private async void OnFocuseOut()

+ 0 - 35
GameClient/Assets/Game/HotUpdate/Views/ViewGlobal.cs

@@ -33,40 +33,5 @@ namespace GFGGame
             comHolder.target.SetPosition(pos.x, pos.y, 0);
         }
 
-        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 static void ShowGmView()
-        {
-            if (ViewManager.isViewOpen(typeof(PhotographView).FullName)) return;
-            ViewManager.Show(ViewName.GM_PANEL_VIEW);
-        }
     }
 }