Ejemplo n.º 1
0
 public void OnEctypdDiffItemSelect(SingleEctypeDiffItem selectItem)
 {
     m_EctypeContainerListPanel.Show(selectItem.MyConfigData, this);
     if (jumpPointEctypeID != -1)
     {
         jumpPointEctypeID = -1;
     }
     m_EctypeContainerListPanel.TweenShow();
 }
Ejemplo n.º 2
0
 public void OnMyChildItemClick(SingleEctypeDiffItem clickItem)
 {
     if (curSelectItem == clickItem)
     {
         return;
     }
     curSelectItem = clickItem;
     MyEctypeDiffItemList.ApplyAllItem(C => C.SetSelectStatus(clickItem));
     MyParent.OnEctypdDiffItemSelect(clickItem);
 }
Ejemplo n.º 3
0
        void SelectAndMoveToEctypeDiffItem(SingleEctypeDiffItem item, int index)
        {
            OnMyChildItemClick(item);
            //SoundManager.Instance.PlaySoundEffect("Sound_UIEff_EctypeTabFallDown");
            if (TweenFloatObj != null)
            {
                DestroyImmediate(TweenFloatObj);
            }
            int posY = 126 * ((index + 1 < 4 ? 4 : index + 1) - 4);        //126*((MyEctypeDiffItemList.Count<4?4:MyEctypeDiffItemList.Count)-4)

            TweenFloatObj = TweenFloat.Begin(animTime, startPosY, posY, SetDraggablePanelPosition, PlaySound);
        }
Ejemplo n.º 4
0
        public void SetSelectStatus(SingleEctypeDiffItem selectItem)
        {
            bool isSelect = selectItem == this;

            if (childPanel == null)
            {
                childPanel = transform.Find("Panel");
            }
            childPanel.localScale = isSelect?new Vector3(1.8f, 1.8f, 1.8f):Vector3.one;
            if (!IsLock)
            {
                m_IconSprite.color = isSelect?Color.white:Color.gray;
                SelectStatus.gameObject.SetActive(isSelect);
                NameLabel.gameObject.SetActive(isSelect && !IsLock);
            }
        }
Ejemplo n.º 5
0
        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);
            }
        }