From 13cc3cead6484a2b227c227b84bddf1e42ed8d2e Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期五, 29 三月 2019 16:43:05 +0800
Subject: [PATCH] 3335 主界面修改.

---
 System/MainInterfacePanel/HighSettingFadeInFadeOut.cs |  851 +++++++++++---------------------------------------------
 1 files changed, 175 insertions(+), 676 deletions(-)

diff --git a/System/MainInterfacePanel/HighSettingFadeInFadeOut.cs b/System/MainInterfacePanel/HighSettingFadeInFadeOut.cs
index f592151..1ec793e 100644
--- a/System/MainInterfacePanel/HighSettingFadeInFadeOut.cs
+++ b/System/MainInterfacePanel/HighSettingFadeInFadeOut.cs
@@ -7,80 +7,45 @@
 using UnityEngine;
 using System.Text;
 using Snxxz.UI;
-
-using System.Globalization;
-using System.Collections;
+using UnityEngine.UI;
 
 namespace Snxxz.UI
 {
-    public class SelectCaseRequest
-    {
-        public Transform Tran;
-        public bool IsNagaaki;//鏄惁甯告樉
-        public int Index;//涓嬭〃
-    }
-
     public class HighSettingFadeInFadeOut : MonoBehaviour
     {
-        [Header("鍏充簬涓婂眰鎸夐挳缁勭殑鐗规畩鎸夐挳")]
-        public List<int> GroupTopIndexList = new List<int>();
-        [Header("鍏充簬涓嬪眰鎸夐挳缁勭殑鐗规畩鎸夐挳")]
-        public List<int> GroupLowIndexList = new List<int>();
-        [Header("鍏充簬绗笁灞傛寜閽粍鐨勭壒娈婃寜閽�")]
-        public List<int> GroupThreeIndexList = new List<int>();
-        [SerializeField] Transform m_BoxContainerTranTop;//鐢熸垚鐩掍笂灞�
-        [SerializeField] Transform m_BoxContainerTranLow;//鐢熸垚鐩掍笅灞�
-        [SerializeField] Transform m_BoxContainerThree;//绗笁琛岀敓鎴愮洅
+        [SerializeField] Button m_Switch;//鍒囨崲鎸夐挳1
+        [SerializeField] Image m_ArrowOpen;
+        [SerializeField] Image m_ArrowClose;
 
-        [SerializeField] Transform m_GroupIndex;
-        [SerializeField] Transform m_GroupIndex_Top;
-        [SerializeField] Transform m_GroupIndex_Low;
-        [SerializeField] Transform m_GroupIndex_Three;
+        [SerializeField] MainWinTopGrid[] m_GridGroup1;
+        [SerializeField] MainWinTopGrid[] m_GridGroup2;
 
-        Dictionary<int, SelectCaseRequest> AnimationFadeOutDicTop = new Dictionary<int, SelectCaseRequest>();
-        Dictionary<int, SelectCaseRequest> AnimationFadeOutDicLow = new Dictionary<int, SelectCaseRequest>();
-        Dictionary<int, SelectCaseRequest> AnimationFadeOutDicThree = new Dictionary<int, SelectCaseRequest>();
+        State state = State.Closed;
 
-
-        List<SelectCaseRequest> SelectCaseRequestListTop = new List<SelectCaseRequest>();
-        List<SelectCaseRequest> SelectCaseRequestListLow = new List<SelectCaseRequest>();
-        List<SelectCaseRequest> SelectCaseRequestListThree = new List<SelectCaseRequest>();
-
-        List<float> LatencyTimeList = new List<float>();//鍏充簬寤惰繜鏃堕棿
+        float closeTimer = 0f;
 
         TreasureFindHostModel hostModel { get { return ModelCenter.Instance.GetModel<TreasureFindHostModel>(); } }
-        OSGiftModel osGiftModel { get { return ModelCenter.Instance.GetModel<OSGiftModel>(); } }
         LimitedTimePackageItemClassModel limitedTimePackageItemModel { get { return ModelCenter.Instance.GetModel<LimitedTimePackageItemClassModel>(); } }
         ImpactRankModel impactRankModel { get { return ModelCenter.Instance.GetModel<ImpactRankModel>(); } }
-        CrossServerOneVsOneRewardModel m_CrossServerRewardModel;
-        CrossServerOneVsOneRewardModel crossServerRewardModel { get { return m_CrossServerRewardModel ?? (m_CrossServerRewardModel = ModelCenter.Instance.GetModel<CrossServerOneVsOneRewardModel>()); } }
         OpenServiceAchievementModel OpenServerModel { get { return ModelCenter.Instance.GetModel<OpenServiceAchievementModel>(); } }
-        SpringFestivalModel springFestival { get { return ModelCenter.Instance.GetModel<SpringFestivalModel>(); } }
+
+        void Start()
+        {
+            m_Switch.SetListener(() => { Switch(state == State.Closed); });
+            SwitchImmedidately(false);
+        }
+
         public void Init()
         {
-            if (LatencyTimeList.Count <= 0)
-            {
-                LatencyTimeList.Clear();
-                string str = FuncConfigConfig.Get("MaininterfaceAniTime").Numerical1;
-                string[] StrList = ConfigParse.GetMultipleStr(str);//瑙f瀽鍑烘暟缁�
-                for (int j = 0; j < StrList.Length; j++)
-                {
-                    float number;
-                    if (float.TryParse(StrList[j], NumberStyles.Float, CultureInfo.InvariantCulture, out number))
-                    {
-                        LatencyTimeList.Add(number);
-                    }
-                }
-            }
-            m_GroupIndex.gameObject.SetActive(false);
-            Classify();
+            RefreshGridsActiveState();
+
             TimeUtility.OnServerOpenDayRefresh += OnStepServerDay;
             FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChange;
             hostModel.TreasureFindHostCompleteAct += TreasureFindHostCompleteAct;
             RedpointCenter.Instance.redpointValueChangeEvent += UpdateRedpoint;
             OpenServerActivityCenter.Instance.openServerActivityStateChange += OpenServerActivityStateChange;
-            OperationTimeHepler.Instance.operationStartEvent += operationStartEvent;
-            OperationTimeHepler.Instance.operationEndEvent += operationEndEvent;
+            OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
+            OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
             limitedTimePackageItemModel.UpdateLimitedTimePackageItem += UpdateLimitedTimePackageItem;
             impactRankModel.inImpactRankUpdate += InImpactRankUpdate;
             OpenServerModel.IsOpenEvent += IsOpenEvent;
@@ -88,16 +53,15 @@
             OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent;
         }
 
-        public void Unit()
+        public void UnInit()
         {
-            StopIEnumerator();
             FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChange;
             hostModel.TreasureFindHostCompleteAct -= TreasureFindHostCompleteAct;
             TimeUtility.OnServerOpenDayRefresh -= OnStepServerDay;
             OpenServerActivityCenter.Instance.openServerActivityStateChange -= OpenServerActivityStateChange;
             RedpointCenter.Instance.redpointValueChangeEvent -= UpdateRedpoint;
-            OperationTimeHepler.Instance.operationStartEvent -= operationStartEvent;
-            OperationTimeHepler.Instance.operationEndEvent -= operationEndEvent;
+            OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent;
+            OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent;
             limitedTimePackageItemModel.UpdateLimitedTimePackageItem -= UpdateLimitedTimePackageItem;
             impactRankModel.inImpactRankUpdate -= InImpactRankUpdate;
             OpenServerModel.IsOpenEvent -= IsOpenEvent;
@@ -105,683 +69,218 @@
             OperationTimeHepler.Instance.operationAdvanceEvent -= OperationAdvanceEvent;
         }
 
+        void Switch(bool active)
+        {
+            var index = 0;
+            foreach (var grid in m_GridGroup1)
+            {
+                if (!grid.alwayShow)
+                {
+                    grid.Switch(active, 0);
+                }
+
+                if (grid.gameObject.activeInHierarchy)
+                {
+                    index++;
+                }
+            }
+
+            index = 0;
+            foreach (var grid in m_GridGroup2)
+            {
+                if (!grid.alwayShow)
+                {
+                    grid.Switch(active, (index / 7) + 1);
+                }
+
+                if (grid.gameObject.activeInHierarchy)
+                {
+                    index++;
+                }
+            }
+
+            state = active ? State.Opened : State.Closed;
+            DisplayArrow(state);
+            if (state == State.Opened)
+            {
+                closeTimer = GeneralDefine.mainWinTopCloseTime;
+            }
+        }
+
+        public void SwitchImmedidately(bool active)
+        {
+            foreach (var grid in m_GridGroup1)
+            {
+                if (!grid.alwayShow)
+                {
+                    grid.SwitchImmediately(active, 0);
+                }
+            }
+
+            var index = 0;
+            foreach (var grid in m_GridGroup2)
+            {
+                if (!grid.alwayShow)
+                {
+                    grid.SwitchImmediately(active, (index / 7) + 1);
+                }
+
+                if (grid.gameObject.activeInHierarchy)
+                {
+                    index++;
+                }
+            }
+
+            state = active ? State.Opened : State.Closed;
+            DisplayArrow(state);
+            if (state == State.Opened)
+            {
+                closeTimer = GeneralDefine.mainWinTopCloseTime;
+            }
+        }
+
         private void OperationAdvanceEvent(Operation obj)
         {
-            Classify();
+            RefreshGridsActiveState();
         }
 
         private void IsOpenEvent()
         {
-            Classify();
+            RefreshGridsActiveState();
         }
 
         private void InImpactRankUpdate()
         {
-            Classify();
+            RefreshGridsActiveState();
         }
 
         private void UpdateLimitedTimePackageItem()
         {
-            Classify();
+            RefreshGridsActiveState();
         }
 
-        private void operationEndEvent(Operation arg1, int arg2)
+        private void OperationEndEvent(Operation arg1, int arg2)
         {
-            Classify();
+            RefreshGridsActiveState();
         }
 
-        private void operationStartEvent(Operation arg1, int arg2)
+        private void OperationStartEvent(Operation arg1, int arg2)
         {
-            Classify();
-
+            RefreshGridsActiveState();
         }
 
         private void UpdateRedpoint(int redPointID)
         {
             if (redPointID == 201 || redPointID == 210)
             {
-                Classify();
+                RefreshGridsActiveState();
             }
         }
 
         private void OpenServerActivityStateChange()
         {
-            Classify();
+            RefreshGridsActiveState();
         }
 
         private void OnStepServerDay()//寮�鏈嶆椿鍔�
         {
-            var _impactRankDays = ModelCenter.Instance.GetModel<ImpactRankModel>().openServerActivityDays;
-            if (TimeUtility.OpenDay >= _impactRankDays)
+            var days = ModelCenter.Instance.GetModel<ImpactRankModel>().openServerActivityDays;
+            if (TimeUtility.OpenDay >= days)
             {
-                Classify();
+                RefreshGridsActiveState();
             }
         }
 
         private void TreasureFindHostCompleteAct()//浠欏疂瀵讳富
         {
-            Classify();
-        }
-        private void OnOSGiftStateChange()
-        {
-            Classify();
-        }
-        public void FadeOut()//娣″嚭
-        {
-            if (this.gameObject.activeInHierarchy)
-            {
-                StartCoroutine("FadeOutTop");
-                StartCoroutine("FadeOutLow");
-                StartCoroutine("FadeOutThree");
-            }
-
-        }
-        public void FadeIn()//娣″叆
-        {
-            if (this.gameObject.activeInHierarchy)
-            {
-                StartCoroutine("FadeInTop");
-                StartCoroutine("FadeInLow");
-                StartCoroutine("FadeInThree");
-            }
-
-        }
-        private void StopIEnumerator()
-        {
-            StopCoroutine("FadeOutTop");
-            StopCoroutine("FadeOutLow");
-            StopCoroutine("FadeInTop");
-            StopCoroutine("FadeInLow");
-            StopCoroutine("FadeOutThree");
-            StopCoroutine("FadeInThree");
-        }
-        IEnumerator FadeOutTop()
-        {
-            int type = 0;
-            for (int i = 0; i < m_BoxContainerTranTop.childCount; i++)
-            {
-                if (i < SelectCaseRequestListTop.Count)
-                {
-                    TopAnimationPlay topAnimationPlay = m_BoxContainerTranTop.GetChild(i).GetComponent<TopAnimationPlay>();
-                    if (!SelectCaseRequestListTop[i].IsNagaaki)
-                    {
-                        yield return new WaitForSeconds(LatencyTimeList[type]);
-                        type += 1;
-                    }
-                    topAnimationPlay.FadeOut();
-                }
-            }
-        }
-        IEnumerator FadeOutLow()
-        {
-            int type = 0;
-            for (int i = 0; i < m_BoxContainerTranLow.childCount; i++)
-            {
-                if (i < SelectCaseRequestListLow.Count)
-                {
-                    TopAnimationPlay topAnimationPlay = m_BoxContainerTranLow.GetChild(i).GetComponent<TopAnimationPlay>();
-                    if (!SelectCaseRequestListLow[i].IsNagaaki)
-                    {
-                        yield return new WaitForSeconds(LatencyTimeList[type]);
-                        type += 1;
-                    }
-                    topAnimationPlay.FadeOut();
-                }
-            }
+            RefreshGridsActiveState();
         }
 
-        IEnumerator FadeOutThree()
-        {
-            int type = 0;
-            for (int i = 0; i < m_BoxContainerThree.childCount; i++)
-            {
-                if (i < SelectCaseRequestListThree.Count)
-                {
-                    TopAnimationPlay topAnimationPlay = m_BoxContainerThree.GetChild(i).GetComponent<TopAnimationPlay>();
-                    if (!SelectCaseRequestListThree[i].IsNagaaki)
-                    {
-                        yield return new WaitForSeconds(LatencyTimeList[type]);
-                        type += 1;
-                    }
-                    topAnimationPlay.FadeOut();
-                }
-            }
-        }
-
-        IEnumerator FadeInTop()
-        {
-            int type = 0;
-            for (int i = 0; i < m_BoxContainerTranTop.childCount; i++)
-            {
-                if (i < SelectCaseRequestListTop.Count)
-                {
-                    TopAnimationPlay topAnimationPlay = m_BoxContainerTranTop.GetChild(i).GetComponent<TopAnimationPlay>();
-                    if (!SelectCaseRequestListTop[i].IsNagaaki)
-                    {
-                        yield return new WaitForSeconds(LatencyTimeList[type]);
-                        type += 1;
-                    }
-                    topAnimationPlay.FadeIn();
-                }
-            }
-        }
-        IEnumerator FadeInLow()
-        {
-            int type = 0;
-            for (int i = 0; i < m_BoxContainerTranLow.childCount; i++)
-            {
-                if (i < SelectCaseRequestListLow.Count)
-                {
-                    TopAnimationPlay topAnimationPlay = m_BoxContainerTranLow.GetChild(i).GetComponent<TopAnimationPlay>();
-                    if (!SelectCaseRequestListLow[i].IsNagaaki)
-                    {
-                        yield return new WaitForSeconds(LatencyTimeList[type]);
-                        type += 1;
-                    }
-                    topAnimationPlay.FadeIn();
-                }
-            }
-        }
-
-        IEnumerator FadeInThree()
-        {
-            int type = 0;
-            for (int i = 0; i < m_BoxContainerThree.childCount; i++)
-            {
-                if (i < SelectCaseRequestListThree.Count)
-                {
-                    TopAnimationPlay topAnimationPlay = m_BoxContainerThree.GetChild(i).GetComponent<TopAnimationPlay>();
-                    if (!SelectCaseRequestListThree[i].IsNagaaki)
-                    {
-                        yield return new WaitForSeconds(LatencyTimeList[type]);
-                        type += 1;
-                    }
-                    topAnimationPlay.FadeIn();
-                }
-            }
-        }
-        public void PositionNow()//绔嬪嵆鍑虹幇
-        {
-            for (int i = 0; i < m_BoxContainerTranTop.childCount; i++)//1
-            {
-                TopAnimationPlay topAnimationPlay = m_BoxContainerTranTop.GetChild(i).GetComponent<TopAnimationPlay>();
-                topAnimationPlay.PositionNow();
-            }
-            for (int i = 0; i < m_BoxContainerTranLow.childCount; i++)//2
-            {
-                TopAnimationPlay topAnimationPlay = m_BoxContainerTranLow.GetChild(i).GetComponent<TopAnimationPlay>();
-                topAnimationPlay.PositionNow();
-            }
-            for (int i = 0; i < m_BoxContainerThree.childCount; i++)//3
-            {
-                TopAnimationPlay topAnimationPlay = m_BoxContainerThree.GetChild(i).GetComponent<TopAnimationPlay>();
-                topAnimationPlay.PositionNow();
-            }
-        }
-        public void PositionDel()//绔嬪嵆娑堝け
-        {
-            for (int i = 0; i < m_BoxContainerTranTop.childCount; i++)//1
-            {
-                if (i < SelectCaseRequestListTop.Count)
-                {
-                    TopAnimationPlay topAnimationPlay = m_BoxContainerTranTop.GetChild(i).GetComponent<TopAnimationPlay>();
-                    topAnimationPlay.ImmediatelyDisappear();
-                }
-            }
-            for (int i = 0; i < m_BoxContainerTranLow.childCount; i++)//2
-            {
-                if (i < SelectCaseRequestListLow.Count)
-                {
-                    TopAnimationPlay topAnimationPlay = m_BoxContainerTranLow.GetChild(i).GetComponent<TopAnimationPlay>();
-                    topAnimationPlay.ImmediatelyDisappear();
-                }
-            }
-            for (int i = 0; i < m_BoxContainerThree.childCount; i++)//3
-            {
-                if (i < SelectCaseRequestListThree.Count)
-                {
-                    TopAnimationPlay topAnimationPlay = m_BoxContainerThree.GetChild(i).GetComponent<TopAnimationPlay>();
-                    topAnimationPlay.ImmediatelyDisappear();
-                }
-            }
-        }
-        public bool GetIsFadeIn()//鍒ゆ柇鏄惁娣″叆
-        {
-            for (int i = 0; i < m_BoxContainerTranTop.childCount; i++)
-            {
-                if (i < SelectCaseRequestListTop.Count)
-                {
-                    TopAnimationPlay topAnimationPlay = m_BoxContainerTranTop.GetChild(i).GetComponent<TopAnimationPlay>();
-                    if (!topAnimationPlay.IsplayAnimator)
-                    {
-                        continue;
-                    }
-                    if (topAnimationPlay.CanvasGroup.alpha > 0.3)
-                    {
-                        return true;
-                    }
-                }
-            }
-            for (int i = 0; i < m_BoxContainerTranLow.childCount; i++)
-            {
-                if (i < SelectCaseRequestListLow.Count)
-                {
-                    TopAnimationPlay topAnimationPlay = m_BoxContainerTranLow.GetChild(i).GetComponent<TopAnimationPlay>();
-                    if (!topAnimationPlay.IsplayAnimator)
-                    {
-                        continue;
-                    }
-                    if (topAnimationPlay.CanvasGroup.alpha > 0.3)
-                    {
-                        return true;
-                    }
-                }
-            }
-            for (int i = 0; i < m_BoxContainerThree.childCount; i++)
-            {
-                if (i < SelectCaseRequestListThree.Count)
-                {
-                    TopAnimationPlay topAnimationPlay = m_BoxContainerThree.GetChild(i).GetComponent<TopAnimationPlay>();
-                    if (!topAnimationPlay.IsplayAnimator)
-                    {
-                        continue;
-                    }
-                    if (topAnimationPlay.CanvasGroup.alpha > 0.3)
-                    {
-                        return true;
-                    }
-                }
-            }
-            return false;
-        }
-
-        private void Classify()
-        {
-            PositionNow();
-            PositionReduction();
-            SetGroupTop();
-            SetGroupLow();
-            SetfatherNodeTop();
-            SetfatherNodeLow();
-            SetfatherNodeThree();
-        }
-
-        private void SetGroupTop()//涓婂眰鍒嗙粍
-        {
-            AnimationFadeOutDicTop.Clear();
-            for (int i = 0; i < m_GroupIndex_Top.childCount; i++)
-            {
-                HighBtnRecord highBtnRecord = m_GroupIndex_Top.GetChild(i).GetComponent<HighBtnRecord>();
-                if (m_GroupIndex_Top.GetChild(i).GetComponent<UIFuncOpen>() != null)
-                {
-                    if (!FuncOpen.Instance.IsFuncOpen(m_GroupIndex_Top.GetChild(i).GetComponent<UIFuncOpen>().id))
-                    {
-                        if (highBtnRecord.IsBool && !AnimationFadeOutDicTop.ContainsKey(highBtnRecord.Index))
-                        {
-                            SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                            selectCaseRequest.Tran = m_GroupIndex_Top.GetChild(i);
-                            selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                            selectCaseRequest.Index = highBtnRecord.Index;
-                            AnimationFadeOutDicTop.Add(highBtnRecord.Index, selectCaseRequest);
-                        }
-                    }
-                    else
-                    {
-                        if (!AnimationFadeOutDicTop.ContainsKey(highBtnRecord.Index))
-                        {
-                            SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                            selectCaseRequest.Tran = m_GroupIndex_Top.GetChild(i);
-                            selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                            selectCaseRequest.Index = highBtnRecord.Index;
-                            AnimationFadeOutDicTop.Add(highBtnRecord.Index, selectCaseRequest);
-                        }
-                    }
-                }
-                else
-                {
-                    if (GroupTopIndexList.Contains(highBtnRecord.Index))
-                    {
-                        int IndexOf = GroupTopIndexList.IndexOf(highBtnRecord.Index);
-                        if (IndexOf == 0)
-                        {
-                            if (crossServerRewardModel.IsShowCrossServerOneVsOne())//璺ㄦ湇
-                            {
-                                SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                                selectCaseRequest.Tran = m_GroupIndex_Top.GetChild(i);
-                                selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                                selectCaseRequest.Index = highBtnRecord.Index;
-                                AnimationFadeOutDicTop.Add(highBtnRecord.Index, selectCaseRequest);
-
-                            }
-                        }
-                        //    if (ModelCenter.Instance.GetModel<OSGiftModel>().activate)//瓒呭�肩ぜ鍖�
-                        //{
-                        //    if (!AnimationFadeOutDicTop.ContainsKey(highBtnRecord.Index))
-                        //    {
-                        //        SelectCaseRequest selectCaseRequest = new SelectCaseRequest();
-                        //        selectCaseRequest.Tran = m_GroupIndex_Top.GetChild(i);
-                        //        selectCaseRequest.IsNagaaki = highBtnRecord.IsNagaaki;
-                        //        AnimationFadeOutDicTop.Add(highBtnRecord.Index, selectCaseRequest);
-                        //    }
-                        //}
-                    }
-                }
-            }
-        }
-        private void SetGroupLow()//涓嬪眰鍒嗙粍
-        {
-            AnimationFadeOutDicLow.Clear();
-            AnimationFadeOutDicThree.Clear();
-            for (int i = 0; i < m_GroupIndex_Low.childCount; i++)
-            {
-                HighBtnRecord highBtnRecord = m_GroupIndex_Low.GetChild(i).GetComponent<HighBtnRecord>();
-                IsPlayerUIeffect isPlayerUIeffect = m_GroupIndex_Low.GetChild(i).GetComponent<IsPlayerUIeffect>();
-                if (m_GroupIndex_Low.GetChild(i).GetComponent<UIFuncOpen>() != null)//鏈夊姛鑳藉紑鍚疘D
-                {
-                    int openFucID = m_GroupIndex_Low.GetChild(i).GetComponent<UIFuncOpen>().id;
-                    if (!FuncOpen.Instance.IsFuncOpen(openFucID))
-                    {
-                        if (highBtnRecord.IsBool && !AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index))
-                        {
-                            if (isPlayerUIeffect.RedPointId == 201 || isPlayerUIeffect.RedPointId == 210)
-                            {
-                                if (RedpointCenter.Instance.GetRedpointState(isPlayerUIeffect.RedPointId) == RedPointState.GetReward)
-                                {
-                                    m_GroupIndex_Low.GetChild(i).GetComponent<HighBtnRecord>().IsNagaaki = true;
-                                    highBtnRecord.IsNagaaki = true;
-                                }
-                                else
-                                {
-                                    m_GroupIndex_Low.GetChild(i).GetComponent<HighBtnRecord>().IsNagaaki = false;
-                                    highBtnRecord.IsNagaaki = false;
-                                }
-                            }
-                            SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
-                        }
-                    }
-                    else
-                    {
-                        int OpenFuncID = m_GroupIndex_Low.GetChild(i).GetComponent<UIFuncOpen>().id;
-                        if (OpenFuncID == 124 && FuncOpen.Instance.IsFuncOpen(124))//浠欏疂瀵讳富
-                        {
-                            if (hostModel.CheckTreasureFindHostFinish())//浠欏疂瀵讳富鍏抽棴
-                            {
-                                continue;
-                            }
-                        }
-                        if (!AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index))
-                        {
-                            if (isPlayerUIeffect.RedPointId == 201 /*|| isPlayerUIeffect.RedPointId == 210*/)//201(绂忓埄)锛�210锛堜粰瀹濆涓伙級
-                            {
-                                if (RedpointCenter.Instance.GetRedpointState(isPlayerUIeffect.RedPointId) == RedPointState.GetReward)
-                                {
-                                    m_GroupIndex_Low.GetChild(i).GetComponent<HighBtnRecord>().IsNagaaki = true;
-                                    highBtnRecord.IsNagaaki = true;
-                                }
-                                else
-                                {
-                                    m_GroupIndex_Low.GetChild(i).GetComponent<HighBtnRecord>().IsNagaaki = false;
-                                    highBtnRecord.IsNagaaki = false;
-                                }
-                            }
-                            SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
-                        }
-                    }
-                }
-                else
-                {
-                    if (GroupLowIndexList.Contains(highBtnRecord.Index))
-                    {
-                        int IndexOf = GroupLowIndexList.IndexOf(highBtnRecord.Index);
-                        switch (IndexOf)
-                        {
-
-                            case 0:
-                                if (!AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index) && OperationTimeHepler.Instance.SatisfyOpenCondition(Operation.FairyCeremony))//绮剧伒鐩涘吀
-                                {
-                                    SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
-                                }
-                                break;
-                            case 1:
-                                if (!AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index) && OperationTimeHepler.Instance.SatisfyOpenCondition(Operation.NewYearFairyCeremony))//绮剧伒鐩涘吀
-                                {
-                                    SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
-                                }
-                                break;
-                            case 2:
-                                var _funcOrder = 0;
-                                if (OpenServerActivityCenter.Instance.IsAnyActivityOpen(out _funcOrder))//绮惧僵娲诲姩
-                                {
-                                    if (!AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index))
-                                    {
-                                        SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
-                                    }
-                                }
-                                break;
-                            case 3:
-                                bool Isopen = impactRankModel.IsInImpactRank;
-                                if (!AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index) && Isopen)//鍏ㄦ皯鍐叉
-                                {
-                                    SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
-                                }
-                                break;
-                            case 4:
-                                bool Is_open = OpenServerModel.IsOpenFeatures();
-                                bool _isOpen = springFestival.IsOpenFeatures();
-                                if (!AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index) && (Is_open || _isOpen))//7澶╁绀�
-                                {
-                                    SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
-                                }
-                                break;
-                            case 5:
-                                bool Isopen5 = OpenServerActivityCenter.Instance.IsActivityOpen(14);
-                                if (!AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index) && Isopen5)//闄愭椂鎶㈣喘
-                                {
-                                    SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
-                                }
-                                break;
-                            case 6:
-                                if (!AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index) && limitedTimePackageItemModel.IsExpired())//闄愭椂绀煎寘
-                                {
-                                    SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
-                                }
-                                break;
-                            case 7:
-                                bool Isopen7 = OpenServerActivityCenter.Instance.IsActivityOpen(4);
-                                if (!AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index) && Isopen7)//闄愭椂鐗规儬
-                                {
-                                    SetTranInBox(m_GroupIndex_Low.GetChild(i), highBtnRecord);
-                                }
-                                break;
-                            case 8:
-                                break;
-                            default:
-                                break;
-                        }
-                    }
-                }
-            }
-        }
-
-
-        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)//涓婂眰
-            {
-                foreach (var key in AnimationFadeOutDicTop.Keys)
-                {
-                    AnimationFadeOutDicTop[key].Tran.SetParent(m_GroupIndex_Top);
-                    AnimationFadeOutDicTop[key].Tran.SetSiblingIndex(key);
-                }
-            }
-            if (AnimationFadeOutDicLow.Count > 0)//涓棿
-            {
-                foreach (var key in AnimationFadeOutDicLow.Keys)
-                {
-                    AnimationFadeOutDicLow[(AnimationFadeOutDicLow[key].Index)].Tran.SetParent(m_GroupIndex_Low);
-                    AnimationFadeOutDicLow[(AnimationFadeOutDicLow[key].Index)].Tran.SetSiblingIndex((AnimationFadeOutDicLow[key].Index));
-                }
-            }
-            if (AnimationFadeOutDicThree.Count > 0)//绗笁灞�(鎷夊埌绗簩灞�)
-            {
-                foreach (var key in AnimationFadeOutDicThree.Keys)
-                {
-                    AnimationFadeOutDicThree[(AnimationFadeOutDicThree[key].Index)].Tran.SetParent(m_GroupIndex_Low);
-                    AnimationFadeOutDicThree[(AnimationFadeOutDicThree[key].Index)].Tran.SetSiblingIndex((AnimationFadeOutDicThree[key].Index));
-                }
-            }
-        }
-        private void SetfatherNodeTop()//璁剧疆鐖惰妭鐐逛笂灞�
-        {
-            SelectCaseRequestListTop.Clear();
-            foreach (var key in AnimationFadeOutDicTop.Keys)
-            {
-                SelectCaseRequestListTop.Add(AnimationFadeOutDicTop[key]);
-            }
-            for (int i = 0; i < m_BoxContainerTranTop.childCount; i++)
-            {
-                int type = i;
-                Transform tran = m_BoxContainerTranTop.GetChild(i);
-                TopAnimationPlay topAnimationPlay = tran.GetComponent<TopAnimationPlay>();
-                if (type < SelectCaseRequestListTop.Count)
-                {
-                    tran.gameObject.SetActive(true);
-                    SelectCaseRequestListTop[type].Tran.SetParent(tran);
-                    SelectCaseRequestListTop[type].Tran.localPosition = Vector3.zero;
-                    topAnimationPlay.IsplayAnimator = !SelectCaseRequestListTop[type].IsNagaaki;
-                }
-                else
-                {
-                    tran.gameObject.SetActive(false);
-                    topAnimationPlay.IsplayAnimator = false;
-                }
-            }
-        }
-        private void SetfatherNodeLow()//璁剧疆鐖惰妭鐐逛笅灞�
-        {
-            SelectCaseRequestListLow.Clear();
-            foreach (var key in AnimationFadeOutDicLow.Keys)
-            {
-                SelectCaseRequestListLow.Add(AnimationFadeOutDicLow[key]);
-            }
-            SelectCaseRequestListLow.Sort(Compare);
-            for (int i = 0; i < m_BoxContainerTranLow.childCount; i++)
-            {
-                int type = i;
-                Transform tran = m_BoxContainerTranLow.GetChild(i);
-                TopAnimationPlay topAnimationPlay = tran.GetComponent<TopAnimationPlay>();
-                if (type < SelectCaseRequestListLow.Count)
-                {
-                    tran.gameObject.SetActive(true);
-                    SelectCaseRequestListLow[type].Tran.SetParent(tran);
-                    SelectCaseRequestListLow[type].Tran.localPosition = Vector3.zero;
-                    topAnimationPlay.IsplayAnimator = !SelectCaseRequestListLow[type].IsNagaaki;
-                }
-                else
-                {
-                    tran.gameObject.SetActive(false);
-                    topAnimationPlay.IsplayAnimator = false;
-                }
-            }
-        }
-
-
-        private void SetfatherNodeThree()//璁剧疆鐖惰妭鐐圭涓夊眰
-        {
-            SelectCaseRequestListThree.Clear();
-            foreach (var key in AnimationFadeOutDicThree.Keys)
-            {
-                SelectCaseRequestListThree.Add(AnimationFadeOutDicThree[key]);
-            }
-            SelectCaseRequestListThree.Sort(Compare);
-            for (int i = 0; i < m_BoxContainerThree.childCount; i++)
-            {
-                int type = i;
-                Transform tran = m_BoxContainerThree.GetChild(i);
-                TopAnimationPlay topAnimationPlay = tran.GetComponent<TopAnimationPlay>();
-                if (type < SelectCaseRequestListThree.Count)
-                {
-                    tran.gameObject.SetActive(true);
-                    SelectCaseRequestListThree[type].Tran.SetParent(tran);
-                    SelectCaseRequestListThree[type].Tran.localPosition = Vector3.zero;
-                    topAnimationPlay.IsplayAnimator = !SelectCaseRequestListThree[type].IsNagaaki;
-                }
-                else
-                {
-                    tran.gameObject.SetActive(false);
-                    topAnimationPlay.IsplayAnimator = false;
-                }
-            }
-
-        }
-        int Compare(SelectCaseRequest x, SelectCaseRequest y)
-        {
-            bool havex = x.IsNagaaki;
-            bool havey = y.IsNagaaki;
-            if (havex.CompareTo(havey) != 0)
-            {
-                return -havex.CompareTo(havey);
-            }
-            if (x.Index.CompareTo(y.Index) != 0)
-            {
-                return x.Index.CompareTo(y.Index);
-            }
-            return 1;
-        }
         private void OnFuncStateChange(int obj)
         {
-            Classify();
+            RefreshGridsActiveState();
+        }
+
+        private void RefreshGridsActiveState()
+        {
+            foreach (var grid in m_GridGroup1)
+            {
+                var active = grid.IsOpen();
+                if (active && !grid.gameObject.activeSelf)
+                {
+                    grid.gameObject.SetActive(true);
+                }
+
+                if (!active && grid.gameObject.activeSelf)
+                {
+                    grid.gameObject.SetActive(false);
+                }
+            }
+
+            foreach (var grid in m_GridGroup2)
+            {
+                var active = grid.IsOpen();
+                if (active && !grid.gameObject.activeSelf)
+                {
+                    grid.gameObject.SetActive(true);
+                }
+
+                if (!active && grid.gameObject.activeSelf)
+                {
+                    grid.gameObject.SetActive(false);
+                }
+            }
+
         }
 
         public bool IsShowButton()//鏄惁鏄剧ず鍒囨崲鎸夐挳
         {
-            bool boolOpen = false;
-            for (int i = 0; i < SelectCaseRequestListTop.Count; i++)
+            foreach (var grid in m_GridGroup1)
             {
-                if (!SelectCaseRequestListTop[i].IsNagaaki)
+                if (!grid.alwayShow)
                 {
-                    boolOpen = true;
+                    return true;
                 }
-
             }
-            for (int i = 0; i < SelectCaseRequestListLow.Count; i++)
+
+            foreach (var grid in m_GridGroup2)
             {
-                if (!SelectCaseRequestListLow[i].IsNagaaki)
+                if (!grid.alwayShow)
                 {
-                    boolOpen = true;
+                    return true;
                 }
-
             }
-            for (int i = 0; i < SelectCaseRequestListThree.Count; i++)
-            {
-                if (!SelectCaseRequestListThree[i].IsNagaaki)
-                {
-                    boolOpen = true;
-                }
 
-            }
-            return boolOpen;
+            return false;
         }
+
+        private void LateUpdate()
+        {
+            if (!NewBieCenter.Instance.inGuiding)
+            {
+                if (state == State.Opened)
+                {
+                    closeTimer -= Time.deltaTime;
+                    if (closeTimer <= 0f)
+                    {
+                        Switch(false);
+                    }
+                }
+            }
+        }
+
+        private void DisplayArrow(State state)
+        {
+            m_ArrowOpen.gameObject.SetActive(state == State.Opened);
+            m_ArrowClose.gameObject.SetActive(state == State.Closed);
+        }
+
+        public enum State
+        {
+            Opened,
+            Closed,
+        }
+
     }
 
 }

--
Gitblit v1.8.0