public void UnlockPanel(SMSGEctypeSelect_SC sMSGEctypeSelect_SC) { //sMSGEctypeSelect_SC.sMSGEctypeData_SCs.ApplyAllItem(P => TraceUtil.Log("解锁的副本ID:"+P.dwEctypeID+","+P.byDiff)); this.sMSGEctypeSelect_SC = sMSGEctypeSelect_SC; // foreach (var child in sMSGEctypeSelect_SC.sMSGEctypeData_SCs) // { // var EctypeListPanel = LocalEctypePanelList.SingleOrDefault(P => P.ectypeSelectConfigData._lEctypeID == child.dwEctypeID); // if (EctypeListPanel != null) // { // EctypeListPanel.UnlockMyPanel(child); // } // } ShowCurrentEctypeInfo(0); var yaoNvEctypeList = JudgeToCreateSirenEctypeCard(); MoveToLastPanel(yaoNvEctypeList.ToArray()); //本地判断是否开启封妖副本 /* * sMSGEctypeSelect_SC.sYaoqiProp.ApplyAllItem(p => * { * EctypeSelectConfigData ectypeSition; * EctypeConfigManager.Instance.EctypeSelectConfigList.TryGetValue((int)p.dwEctypeSection, out ectypeSition); * if (ectypeSition != null) * { * if (p.dwYaoqiValue >= ectypeSition._lEctypeYaoqiMax) * { * //创建妖女副本 * TraceUtil.Log("[创建妖女副本]" + p.dwEctypeSection); * CreateSirenEctype((int)p.dwEctypeSection); * } * } * }); */ }
public void Show(SMSGEctypeSelect_SC unlockEctypeData, EctypePanleManager myParent, int ectypeID) { Init(); MyParent = myParent; gameObject.SetActive(true); jumpPointEctypeID = ectypeID; //UnlockEctypeData = unlockEctypeData; StartCoroutine(m_EctypeDiffListPanel.Init(unlockEctypeData, this, ectypeID)); //m_EctypeContainerListPanel.TweenShow(); //Invoke ("WaitTweenFun",0.13f); m_CommonPanelTitle.TweenShow(); //SoundManager.Instance.PlaySoundEffect("Sound_UIEff_EctypeUIAppear"); }
public IEnumerator Init(SMSGEctypeSelect_SC unlockEctypeData, EctypePanel_V5 myParent, int ectypeID) { Init(); MyParent = myParent; ResetItemListPosition(); MyEctypeDiffItemList.ApplyAllItem(C => Destroy(C.gameObject)); float startMarkDragpanelPosY = m_UIDraggablePanel.transform.localPosition.y; m_UIDraggablePanel.transform.localPosition = new Vector3(m_UIDraggablePanel.transform.localPosition.x, startPosY, m_UIDraggablePanel.transform.localPosition.z); MyEctypeDiffItemList.Clear(); //指定跳转区域副本ID int singleItemIndex = 0; int areaEctypeID = -1; if (ectypeID != -1) { areaEctypeID = EctypeConfigManager.Instance.GetSelectContainerID(ectypeID); } yield return(null); //UnlockEctypeData = unlockEctypeData; List <int> ectypeDiffID = new List <int>(); SingleEctypeDiffItem tweenDiffItem = null; foreach (var child in unlockEctypeData.sMSGEctypeData_SCs) { //获取区域副本ID int diffID = myParent.GetEctypeDiffID((int)child.dwEctypeContaienrID); if (!ectypeDiffID.Contains(diffID)) { ectypeDiffID.Add(diffID); } } ectypeDiffID.Sort((left, right) => { if (left > right) { return(1); } else if (left == right) { return(0); } else { return(-1); } }); for (int i = 0; i <= ectypeDiffID.Count; i++) { if (i < ectypeDiffID.Count) //显示解锁的副本 { if (areaEctypeID != -1 && areaEctypeID == ectypeDiffID[i]) { singleItemIndex = i; } SingleEctypeDiffItem newItem = CreatObjectToNGUI.InstantiateObj(SingleEctypeDiffItemPrefab, Grid).GetComponent <SingleEctypeDiffItem>(); newItem.Init(EctypeConfigManager.Instance.EctypeSelectConfigList[ectypeDiffID[i]], this); newItem.transform.localPosition = new Vector3(0, 200 - 126 * i, 0); MyEctypeDiffItemList.Add(newItem); } else if (i < EctypeConfigManager.Instance.EctypeSelectConfigList.Count) //显示未解锁的副本,选中最后一个解锁副本 { SingleEctypeDiffItem newItem = CreatObjectToNGUI.InstantiateObj(SingleEctypeDiffItemPrefab, Grid).GetComponent <SingleEctypeDiffItem>(); newItem.Init(null, this); newItem.transform.localPosition = new Vector3(0, 200 - 126 * i, 0); MyEctypeDiffItemList.Add(newItem); //tweenDiffItem = MyEctypeDiffItemList[i-1];//SelectAndMoveToEctypeDiffItem(MyEctypeDiffItemList[i-1]); if (areaEctypeID == -1) { singleItemIndex = i - 1; } tweenDiffItem = MyEctypeDiffItemList[singleItemIndex]; } } DragBackground.transform.localScale = new Vector3(40, 126 * (ectypeDiffID.Count), 0); yield return(null); for (int i = 0; i < MyEctypeDiffItemList.Count; i++) { var newItem = MyEctypeDiffItemList[i]; if (newItem.MyConfigData != null) { newItem.DragAmount = (i + 1) / (float)MyEctypeDiffItemList.Count; newItem.gameObject.RegisterBtnMappingId(newItem.MyConfigData._lEctypeID, UIType.Battle, BtnMapId_Sub.Battle_EctypeTab , NoticeToDragSlerp, newItem.DragAmount); } } if (m_noticeToDragAmount != 0) { m_UIDraggablePanel.transform.localPosition = new Vector3(m_UIDraggablePanel.transform.localPosition.x, startMarkDragpanelPosY, m_UIDraggablePanel.transform.localPosition.z); StartCoroutine(DragAmountSlerp(m_noticeToDragAmount)); m_noticeToDragAmount = 0; if (tweenDiffItem != null) { OnMyChildItemClick(tweenDiffItem); } } else if (tweenDiffItem != null) { SelectAndMoveToEctypeDiffItem(tweenDiffItem, singleItemIndex); } }
//副本更新// //常规副本信息 CommandCallbackType ReceiveEctypeNomalDataHandle(byte[] dataBuffer, int socketID) { EctypeModel.Instance.sMSGEctypeSelect_SC = SMSGEctypeSelect_SC.ParsePackage(dataBuffer); return(CommandCallbackType.Continue); }
//接收副本信息同步及打开副本消息 CommandCallbackType EctypeSelectHandle(byte[] dataBuffer, int socketID) { EctypeModel.Instance.sMSGEctypeSelect_SC = SMSGEctypeSelect_SC.ParsePackage(dataBuffer); //UIEventManager.Instance.TriggerUIEvent(UIEventType.EctypeUIInfo,sMSGEctypeSelect_SC); return(CommandCallbackType.Continue); }