| | |
| | | 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);//解析出数组
|
| | | 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;
|
| | |
| | | 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;
|
| | |
| | | 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)//有功能开启ID
|
| | | {
|
| | | 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,
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|