From 73043015210d7e71400f783b20f2ac599cb9dcb4 Mon Sep 17 00:00:00 2001
From: client_Zxw <826696702@qq.com>
Date: 星期二, 29 一月 2019 10:56:33 +0800
Subject: [PATCH] 3335 代码优化

---
 System/MainInterfacePanel/HighSettingFadeInFadeOut.cs |  193 +++++++----------------------------------------
 1 files changed, 31 insertions(+), 162 deletions(-)

diff --git a/System/MainInterfacePanel/HighSettingFadeInFadeOut.cs b/System/MainInterfacePanel/HighSettingFadeInFadeOut.cs
index 0086be2..a4c55c1 100644
--- a/System/MainInterfacePanel/HighSettingFadeInFadeOut.cs
+++ b/System/MainInterfacePanel/HighSettingFadeInFadeOut.cs
@@ -133,7 +133,7 @@
         private void operationStartEvent(Operation arg1, int arg2)
         {
             Classify();
-          
+
         }
 
         private void UpdateRedpoint(int redPointID)
@@ -496,22 +496,7 @@
                                     highBtnRecord.IsNagaaki = false;
                                 }
                             }
-                            if (AnimationFadeOutDicLow.Count < 6)//------绗簩灞�
-                            {
-                                SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                selectCaseRequest.Index = highBtnRecord.Index;
-                                AnimationFadeOutDicLow.Add(highBtnRecord.Index, selectCaseRequest);
-                            }
-                            else//------绗笁灞�
-                            {
-                                SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                selectCaseRequest.Index = highBtnRecord.Index;
-                                AnimationFadeOutDicThree.Add(highBtnRecord.Index, selectCaseRequest);
-                            }
+                            SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
                         }
                     }
                     else
@@ -539,23 +524,7 @@
                                     highBtnRecord.IsNagaaki = false;
                                 }
                             }
-                            if (AnimationFadeOutDicLow.Count < 6)//------绗簩灞�
-                            {
-                                SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                selectCaseRequest.Index = highBtnRecord.Index;
-                                AnimationFadeOutDicLow.Add(highBtnRecord.Index, selectCaseRequest);
-                            }
-                            else//------绗笁灞�
-                            {
-                                SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                selectCaseRequest.Index = highBtnRecord.Index;
-                                AnimationFadeOutDicThree.Add(highBtnRecord.Index, selectCaseRequest);
-                            }
-
+                            SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
                         }
                     }
                 }
@@ -568,44 +537,14 @@
                         {
                             if (!AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index) && OperationTimeHepler.Instance.SatisfyOpenCondition(Operation.FairyCeremony))//绮剧伒鐩涘吀
                             {
-                                if (AnimationFadeOutDicLow.Count < 6)//------绗簩灞�
-                                {
-                                    SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                    selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                    selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                    selectCaseRequest.Index = highBtnRecord.Index;
-                                    AnimationFadeOutDicLow.Add(highBtnRecord.Index, selectCaseRequest);
-                                }
-                                else//------绗笁灞�
-                                {
-                                    SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                    selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                    selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                    selectCaseRequest.Index = highBtnRecord.Index;
-                                    AnimationFadeOutDicThree.Add(highBtnRecord.Index, selectCaseRequest);
-                                }
+                                SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
                             }
                         }
                         else if (IndexOf == 1)
                         {
                             if (!AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index) && OperationTimeHepler.Instance.SatisfyOpenCondition(Operation.NewYearFairyCeremony))//绮剧伒鐩涘吀
                             {
-                                if (AnimationFadeOutDicLow.Count < 6)//------绗簩灞�
-                                {
-                                    SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                    selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                    selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                    selectCaseRequest.Index = highBtnRecord.Index;
-                                    AnimationFadeOutDicLow.Add(highBtnRecord.Index, selectCaseRequest);
-                                }
-                                else//------绗笁灞�
-                                {
-                                    SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                    selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                    selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                    selectCaseRequest.Index = highBtnRecord.Index;
-                                    AnimationFadeOutDicThree.Add(highBtnRecord.Index, selectCaseRequest);
-                                }
+                                SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
                             }
                         }
                         else if (IndexOf == 2)
@@ -615,22 +554,7 @@
                             {
                                 if (!AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index))
                                 {
-                                    if (AnimationFadeOutDicLow.Count < 6)//------绗簩灞�
-                                    {
-                                        SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                        selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                        selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                        selectCaseRequest.Index = highBtnRecord.Index;
-                                        AnimationFadeOutDicLow.Add(highBtnRecord.Index, selectCaseRequest);
-                                    }
-                                    else//------绗笁灞�
-                                    {
-                                        SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                        selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                        selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                        selectCaseRequest.Index = highBtnRecord.Index;
-                                        AnimationFadeOutDicThree.Add(highBtnRecord.Index, selectCaseRequest);
-                                    }
+                                    SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
                                 }
                             }
                         }
@@ -639,22 +563,7 @@
                             bool Isopen = impactRankModel.IsInImpactRank;
                             if (!AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index) && Isopen)//鍏ㄦ皯鍐叉
                             {
-                                if (AnimationFadeOutDicLow.Count < 6)//------绗簩灞�
-                                {
-                                    SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                    selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                    selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                    selectCaseRequest.Index = highBtnRecord.Index;
-                                    AnimationFadeOutDicLow.Add(highBtnRecord.Index, selectCaseRequest);
-                                }
-                                else//------绗笁灞�
-                                {
-                                    SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                    selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                    selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                    selectCaseRequest.Index = highBtnRecord.Index;
-                                    AnimationFadeOutDicThree.Add(highBtnRecord.Index, selectCaseRequest);
-                                }
+                                SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
                             }
                         }
                         else if (IndexOf == 4)
@@ -663,22 +572,7 @@
                             bool _isOpen = springFestival.IsOpenFeatures();
                             if (!AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index) && (Isopen || _isOpen))//7澶╁绀�
                             {
-                                if (AnimationFadeOutDicLow.Count < 6)//------绗簩灞�
-                                {
-                                    SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                    selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                    selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                    selectCaseRequest.Index = highBtnRecord.Index;
-                                    AnimationFadeOutDicLow.Add(highBtnRecord.Index, selectCaseRequest);
-                                }
-                                else//------绗笁灞�
-                                {
-                                    SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                    selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                    selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                    selectCaseRequest.Index = highBtnRecord.Index;
-                                    AnimationFadeOutDicThree.Add(highBtnRecord.Index, selectCaseRequest);
-                                }
+                                SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
                             }
                         }
                         else if (IndexOf == 5)
@@ -686,44 +580,14 @@
                             bool Isopen = OpenServerActivityCenter.Instance.IsActivityOpen(14);
                             if (!AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index) && Isopen)//闄愭椂鎶㈣喘
                             {
-                                if (AnimationFadeOutDicLow.Count < 6)//------绗簩灞�
-                                {
-                                    SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                    selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                    selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                    selectCaseRequest.Index = highBtnRecord.Index;
-                                    AnimationFadeOutDicLow.Add(highBtnRecord.Index, selectCaseRequest);
-                                }
-                                else//------绗笁灞�
-                                {
-                                    SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                    selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                    selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                    selectCaseRequest.Index = highBtnRecord.Index;
-                                    AnimationFadeOutDicThree.Add(highBtnRecord.Index, selectCaseRequest);
-                                }
+                                SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
                             }
                         }
                         else if (IndexOf == 6)
                         {
                             if (!AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index) && limitedTimePackageItemModel.IsExpired())//闄愭椂绀煎寘
                             {
-                                if (AnimationFadeOutDicLow.Count < 6)//------绗簩灞�
-                                {
-                                    SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                    selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                    selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                    selectCaseRequest.Index = highBtnRecord.Index;
-                                    AnimationFadeOutDicLow.Add(highBtnRecord.Index, selectCaseRequest);
-                                }
-                                else//------绗笁灞�
-                                {
-                                    SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                    selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                    selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                    selectCaseRequest.Index = highBtnRecord.Index;
-                                    AnimationFadeOutDicThree.Add(highBtnRecord.Index, selectCaseRequest);
-                                }
+                                SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
                             }
                         }
                         else if (IndexOf == 7)
@@ -731,22 +595,7 @@
                             bool Isopen = OpenServerActivityCenter.Instance.IsActivityOpen(4);
                             if (!AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index) && Isopen)//闄愭椂鐗规儬
                             {
-                                if (AnimationFadeOutDicLow.Count < 6)//------绗簩灞�
-                                {
-                                    SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                    selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                    selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                    selectCaseRequest.Index = highBtnRecord.Index;
-                                    AnimationFadeOutDicLow.Add(highBtnRecord.Index, selectCaseRequest);
-                                }
-                                else//------绗笁灞�
-                                {
-                                    SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                    selectCaseRequest.Tran = m_GroupIndex_Low.GetChild(i);
-                                    selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                    selectCaseRequest.Index = highBtnRecord.Index;
-                                    AnimationFadeOutDicThree.Add(highBtnRecord.Index, selectCaseRequest);
-                                }
+                                SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
                             }
                         }
                     }
@@ -755,6 +604,26 @@
         }
 
 
+        private void SetTranInBox(Transform tran, HighBtnRecord highBtnRecord)//涓嬪眰鎸夐挳璁剧疆灞傛暟
+        {
+            if (AnimationFadeOutDicLow.Count < 6)//------绗簩灞�
+            {
+                SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
+                selectCaseRequest.Tran = tran;
+                selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
+                selectCaseRequest.Index = highBtnRecord.Index;
+                AnimationFadeOutDicLow.Add(highBtnRecord.Index, selectCaseRequest);
+            }
+            else//------绗笁灞�
+            {
+                SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
+                selectCaseRequest.Tran = tran;
+                selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
+                selectCaseRequest.Index = highBtnRecord.Index;
+                AnimationFadeOutDicThree.Add(highBtnRecord.Index, selectCaseRequest);
+            }
+        }
+
         private void PositionReduction()//杩樺師浣嶇疆锛堟妸鐩掑瓙涓殑浣嶇疆鍏ㄩ儴閲嶆柊鎷夊嚭鏉ワ級
         {
             if (AnimationFadeOutDicTop.Count > 0)//涓婂眰

--
Gitblit v1.8.0