From a22abbeb975f2b30c6784f290d91638f861c5bb9 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期二, 11 六月 2019 14:50:32 +0800
Subject: [PATCH] 7190 主界面功能按钮缩进优化。

---
 System/MainInterfacePanel/MainPositionTween.cs |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/System/MainInterfacePanel/MainPositionTween.cs b/System/MainInterfacePanel/MainPositionTween.cs
index 9ce40fa..cb48d4e 100644
--- a/System/MainInterfacePanel/MainPositionTween.cs
+++ b/System/MainInterfacePanel/MainPositionTween.cs
@@ -122,9 +122,18 @@
         public static bool isDefaultState { get; private set; }
         public static event Action<bool> switchFunctionStateEvent;
 
-        float resetToDefaultTimer = 0;
+        static float resetToDefaultTimer = 0;
+        public static void SetRecoverToSkillTimer()
+        {
+            resetToDefaultTimer = 20f;
+        }
+
         public void SwitchFunctions(SwitchParam switchParams)
         {
+            if (switchParams.manual && switchParams.showDefault)
+            {
+                resetToDefaultTimer = 0f;
+            }
             ProcessSwitch(switchParams);
         }
 
@@ -182,7 +191,11 @@
                     break;
             }
 
-            var rightBottomState = switchParams.showDefault && !isGuiding && !treasureModel.newGotShowing ? RightBottomState.Skill : RightBottomState.Function;
+            var rightBottomState = resetToDefaultTimer <= 0f
+                && switchParams.showDefault
+                && !isGuiding
+                && !treasureModel.newGotShowing ? RightBottomState.Skill : RightBottomState.Function;
+
             switch (rightBottomState)
             {
                 case RightBottomState.Function:
@@ -212,7 +225,7 @@
             }
 
             isDefaultState = rightBottomState == RightBottomState.Skill;
-            resetToDefaultTimer = !isDefaultState ? 7f : 0f;
+            resetToDefaultTimer = !isDefaultState ? 20f : 0f;
             m_RayMask.gameObject.SetActive(!isDefaultState);
 
             if (switchParams.immediately)
@@ -242,11 +255,7 @@
                 return;
             }
 
-            SwitchFunctions(new SwitchParam()
-            {
-                immediately = false,
-                showDefault = true,
-            });
+            resetToDefaultTimer = 0.0001f;
         }
 
         private void OnSwitchAccount()
@@ -277,6 +286,7 @@
         {
             public bool showDefault;
             public bool immediately;
+            public bool manual;
         }
 
     }

--
Gitblit v1.8.0