//-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Wednesday, April 11, 2018 //-------------------------------------------------------- using System; using System.Collections.Generic; using UnityEngine; using System.Text; using Snxxz.UI; using TableConfig; using System.Globalization; using System.Collections; namespace Snxxz.UI { public class SelectCaseRequest { public Transform Tran; public bool IsNagaaki;//是否常显 public int Index;//下表 } public class HighSettingFadeInFadeOut : MonoBehaviour { [Header("关于上层按钮组的特殊按钮")] public List GroupTopIndexList = new List(); [Header("关于下层按钮组的特殊按钮")] public List GroupLowIndexList = new List(); [Header("关于第三层按钮组的特殊按钮")] public List GroupThreeIndexList = new List(); [SerializeField] Transform m_BoxContainerTranTop;//生成盒上层 [SerializeField] Transform m_BoxContainerTranLow;//生成盒下层 [SerializeField] Transform m_BoxContainerThree;//第三行生成盒 [SerializeField] Transform m_GroupIndex; [SerializeField] Transform m_GroupIndex_Top; [SerializeField] Transform m_GroupIndex_Low; [SerializeField] Transform m_GroupIndex_Three; Dictionary AnimationFadeOutDicTop = new Dictionary(); Dictionary AnimationFadeOutDicLow = new Dictionary(); Dictionary AnimationFadeOutDicThree = new Dictionary(); List SelectCaseRequestListTop = new List(); List SelectCaseRequestListLow = new List(); List SelectCaseRequestListThree = new List(); List LatencyTimeList = new List();//关于延迟时间 TreasureFindHostModel hostModel { get { return ModelCenter.Instance.GetModel(); } } OSGiftModel osGiftModel { get { return ModelCenter.Instance.GetModel(); } } LimitedTimePackageItemClassModel limitedTimePackageItemModel { get { return ModelCenter.Instance.GetModel(); } } ImpactRankModel impactRankModel { get { return ModelCenter.Instance.GetModel(); } } public void Init() { if (LatencyTimeList.Count <= 0) { LatencyTimeList.Clear(); string str = Config.Instance.Get("MaininterfaceAniTime").Numerical1; string[] StrList = ConfigParse.GetMultipleStr(str);//解析出数组 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(); 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; limitedTimePackageItemModel.UpdateLimitedTimePackageItem += UpdateLimitedTimePackageItem; impactRankModel.inImpactRankUpdate += InImpactRankUpdate; } public void Unit() { 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; limitedTimePackageItemModel.UpdateLimitedTimePackageItem -= UpdateLimitedTimePackageItem; impactRankModel.inImpactRankUpdate -= InImpactRankUpdate; } private void InImpactRankUpdate() { Classify(); } private void UpdateLimitedTimePackageItem() { Classify(); } private void operationEndEvent(Operation arg1, int arg2) { if (arg1 == Operation.FairyCeremony) { Classify(); } } private void operationStartEvent(Operation arg1, int arg2) { if (arg1 == Operation.FairyCeremony) { Classify(); } } private void UpdateRedpoint(int redPointID) { if (redPointID == 201 || redPointID == 210) { Classify(); } } private void OpenServerActivityStateChange() { Classify(); } private void OnStepServerDay()//开服活动 { var _impactRankDays = ModelCenter.Instance.GetModel().openServerActivityDays; if (TimeUtility.OpenDay >= _impactRankDays) { Classify(); } } 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(); 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(); if (!SelectCaseRequestListLow[i].IsNagaaki) { yield return new WaitForSeconds(LatencyTimeList[type]); type += 1; } topAnimationPlay.FadeOut(); } } } 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(); 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(); 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(); 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(); 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.PositionNow(); } for (int i = 0; i < m_BoxContainerTranLow.childCount; i++)//2 { TopAnimationPlay topAnimationPlay = m_BoxContainerTranLow.GetChild(i).GetComponent(); topAnimationPlay.PositionNow(); } for (int i = 0; i < m_BoxContainerThree.childCount; i++)//3 { TopAnimationPlay topAnimationPlay = m_BoxContainerThree.GetChild(i).GetComponent(); 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.ImmediatelyDisappear(); } } for (int i = 0; i < m_BoxContainerTranLow.childCount; i++)//2 { if (i < SelectCaseRequestListLow.Count) { TopAnimationPlay topAnimationPlay = m_BoxContainerTranLow.GetChild(i).GetComponent(); topAnimationPlay.ImmediatelyDisappear(); } } for (int i = 0; i < m_BoxContainerThree.childCount; i++)//3 { if (i < SelectCaseRequestListThree.Count) { TopAnimationPlay topAnimationPlay = m_BoxContainerThree.GetChild(i).GetComponent(); 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(); 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(); 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(); 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(); if (m_GroupIndex_Top.GetChild(i).GetComponent() != null) { if (!FuncOpen.Instance.IsFuncOpen(m_GroupIndex_Top.GetChild(i).GetComponent().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)) //{ // if (ModelCenter.Instance.GetModel().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(); IsPlayerUIeffect isPlayerUIeffect = m_GroupIndex_Low.GetChild(i).GetComponent(); if (m_GroupIndex_Low.GetChild(i).GetComponent() != null)//有功能开启ID { int openFucID = m_GroupIndex_Low.GetChild(i).GetComponent().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().IsNagaaki = true; highBtnRecord.IsNagaaki = true; } else { m_GroupIndex_Low.GetChild(i).GetComponent().IsNagaaki = false; 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); } } } else { int OpenFuncID = m_GroupIndex_Low.GetChild(i).GetComponent().id; if (OpenFuncID == 124 && FuncOpen.Instance.IsFuncOpen(124))//仙宝寻主 { if (hostModel.CheckTreasureFindHostFinish())//仙宝寻主关闭 { continue; } } if (!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().IsNagaaki = true; highBtnRecord.IsNagaaki = true; } else { m_GroupIndex_Low.GetChild(i).GetComponent().IsNagaaki = false; 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); } } } } else { if (GroupLowIndexList.Contains(highBtnRecord.Index)) { int IndexOf = GroupLowIndexList.IndexOf(highBtnRecord.Index); if (IndexOf == 0) { 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); } } } else if (IndexOf == 1) { var _funcOrder = 0; if (OpenServerActivityCenter.Instance.IsAnyActivityOpen(out _funcOrder))//开服活动 { 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); } } } } else if (IndexOf == 2) { 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); } } } else if (IndexOf == 3) { 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); } } } else if (IndexOf == 4) { if (!AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index) && OperationTimeHepler.Instance.InOperationTime(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); } } } } } } } 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(); 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(); 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(); 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(); } public bool IsShowButton()//是否显示切换按钮 { bool boolOpen = false; for (int i = 0; i < SelectCaseRequestListTop.Count; i++) { if (!SelectCaseRequestListTop[i].IsNagaaki) { boolOpen = true; } } for (int i = 0; i < SelectCaseRequestListLow.Count; i++) { if (!SelectCaseRequestListLow[i].IsNagaaki) { boolOpen = true; } } for (int i = 0; i < SelectCaseRequestListThree.Count; i++) { if (!SelectCaseRequestListThree[i].IsNagaaki) { boolOpen = true; } } return boolOpen; } } }