Exemple #1
0
        private IEnumerator OnEquipOpen()
        {
            yield return(new WaitForSeconds(0.1f));

            if (11 == GuideManager.Instance.GetCurrentGuidingStepId())
            {
                var equipId = -1;
                var type    = PlayerDataManager.Instance.GetRoleId();
                if (0 == type)
                {
                    equipId = 213101;
                }
                else if (1 == type)
                {
                    equipId = 313101;
                }
                else if (2 == type)
                {
                    equipId = 413101;
                }
                if (-1 == equipId)
                {
                    yield break;
                }

                var idx      = -1;
                var equipBag = PlayerDataManager.Instance.GetBag((int)eBagType.Equip);
                if (null != equipBag)
                {
                    for (var i = 0; i < equipBag.Items.Count; i++)
                    {
                        var equip = equipBag.Items[i];
                        if (null == equip || equipId != equip.ItemId)
                        {
                            continue;
                        }

                        idx = i;
                        break;
                    }
                }

                if (-1 == idx)
                {
                    yield break;
                }
                PackScrollView.SetLookIndex(idx / 5, true);
            }
        }
Exemple #2
0
        IEnumerator DelayMoveScroll(int index)
        {
            yield return(new WaitForSeconds(0.1f));

            if (ScrollView.isActiveAndEnabled)
            {
                ScrollView.SetLookIndex(index - 1, true);
            }
        }
Exemple #3
0
        private void OnEnable()
        {
        #if !UNITY_EDITOR
            try
            {
        #endif
            if (mRemoveBind)
            {
                var selectsCount1 = DungeonSelects.Count;
                for (var i = 0; i < selectsCount1; i++)
                {
                    var s = DungeonSelects[i];
                }

                EventDispatcher.Instance.AddEventListener(CloseUiBindRemove.EVENT_TYPE, OnCloseUiBindRemove);
                EventDispatcher.Instance.AddEventListener(DungeonNetRetCallBack.EVENT_TYPE, OnFuBenNetRetCallBack);
                EventDispatcher.Instance.AddEventListener(DungeonGroupCellClick.EVENT_TYPE, OnClickFuBenGroupCell);

                var controllerBase = UIManager.Instance.GetController(UIConfig.DungeonUI);
                if (controllerBase == null)
                {
                    return;
                }
                Binding.SetBindDataSource(controllerBase.GetDataModel("Team"));
                Binding.SetBindDataSource(controllerBase.GetDataModel(""));
                Binding.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel.Bags.Resources);
                Binding.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel.QueueUpData);
                Binding.SetBindDataSource(PlayerDataManager.Instance.NoticeData);
                DataModel = controllerBase.GetDataModel("") as DungeonDataModel;
                Binding.SetBindDataSource(DataModel);
                if (null != DataModel && null != ScrollView)
                {
                    if (DataModel.SelectDungeon.GroupData.CurrentSelect >= 3)
                    {
                        ScrollView.SetLookIndex(DataModel.SelectDungeon.GroupData.CurrentSelect - 3);
                    }
                }

//              var controller = UIManager.Instance.GetController(UIConfig.ShareFrame);
//              Binding.SetBindDataSource(controller.GetDataModel(""));

                //OnClickMainDungeon();
                //TeamInfo.SetActive(false);
                //MainSweep.SetActive(false);
                //InitDungeonSelect();
            }
            mRemoveBind = true;
        #if !UNITY_EDITOR
        }

        catch (Exception ex)
        {
            Logger.Error(ex.ToString());
        }
        #endif
        }
Exemple #4
0
        private void OnScrollViewMoveEvent(IEvent ievent)
        {
            var e = ievent as RankScrollViewMoveEvent;

            if (null == e || ScrollView == null)
            {
                return;
            }
            ScrollView.SetLookIndex(e.index);
        }
Exemple #5
0
        private void OnEnable()
        {
#if !UNITY_EDITOR
            try
            {
#endif
            foreach (var system in WorshipAnimation)
            {
                system.gameObject.SetActive(false);
            }

            if (hasRemoveBinding)
            {
                EventDispatcher.Instance.AddEventListener(RankNotifyLogic.EVENT_TYPE, OnRankNotifyLogic);
                EventDispatcher.Instance.AddEventListener(CloseUiBindRemove.EVENT_TYPE, OnCloseUiBindRemove);
                EventDispatcher.Instance.AddEventListener(RankRefreshModelView.EVENT_TYPE, OnRankRefreshModelView);
                EventDispatcher.Instance.AddEventListener(RankScrollViewMoveEvent.EVENT_TYPE, OnScrollViewMoveEvent);
                var controllerBase = UIManager.Instance.GetController(UIConfig.RankUI);
                if (controllerBase == null)
                {
                    return;
                }
                Binding.SetBindDataSource(controllerBase.GetDataModel(""));
//              var controller = UIManager.Instance.GetController(UIConfig.ShareFrame);
//              Binding.SetBindDataSource(controller.GetDataModel(""));
                DataModel = controllerBase.GetDataModel("") as RankDataModel;
                Binding.SetBindDataSource(DataModel);
                if (ModelRoot.Character)
                {
                    ModelRoot.Character.gameObject.SetActive(true);
                }
            }
            hasRemoveBinding = true;
            ScrollView       = gameObject.GetComponentInChildren <UIScrollViewSimple>();
            if (IsFirst)
            {
                if (DataModel != null && ScrollView != null)
                {
                    if (DataModel.CurrentSelect > 5)
                    {
                        ScrollView.SetLookIndex(DataModel.CurrentSelect);
                    }
                }
                IsFirst = false;
            }
#if !UNITY_EDITOR
        }

        catch (Exception ex)
        {
            Logger.Error(ex.ToString());
        }
#endif
        }
Exemple #6
0
        private void LookScrollVievCenter(IEvent ievent)
        {
            var e = ievent as UIEvent_ElfSetGridLookIndex;

            if (e.Index == -1)
            {
                ElfScrollView.MoveToOffset(lastScrollViewPos, lastScrollViewOffset);
            }
            else
            {
                ElfScrollView.SetLookIndex(e.Index, false);
            }
        }
Exemple #7
0
        private void BookScrollViewCenter(IEvent ievent)
        {
            var e = ievent as Event_ElfSkillBookLookIndex;

            if (e.Index == -1)
            {
                SkillBookScrollView.MoveToOffset2(lastBookScrollViewPos, lastBookScrollViewOffset);
            }
            else
            {
                SkillBookScrollView.SetLookIndex(e.Index, false);
            }
        }
Exemple #8
0
        private void LookScrollVievCenter(IEvent ievent)
        {
            var e = ievent as UIEvent_ElfSetGridLookIndex;

            if (e.Index == -1)
            {
                ElfScrollView.MoveToOffset(lastScrollViewPos, lastScrollViewOffset);
                // 特殊处理
                var loc = new Vector3();
                loc   = ElfScrollView.transform.localPosition;
                loc.x = 0;
                ElfScrollView.transform.localPosition = loc;
            }
            else
            {
                ElfScrollView.SetLookIndex(e.Index, false);
            }
        }
Exemple #9
0
        private void ScrollCeter(IEvent ievent)
        {
            var e = ievent as UIEvent_StrongSetGridLookIndex;

            if (e.Type == 1)
            {
                lastScrollOffset = StrongScrollView.oldoffset;
                lastScrollPos    = StrongScrollView.transform.localPosition;
            }
            else if (e.Type == 0)
            {
                if (e.Index == -1)
                {
                    StrongScrollView.SetLookIndex(e.Index, false);
                }
                else
                {
                    StrongScrollView.MoveToOffset(lastScrollPos, lastScrollOffset);
                }
            }
        }
Exemple #10
0
 private void ShowExchangeHonor(int index)
 {
     RankHonorList.SetActive(true);
     OpponentList.SetActive(false);
     RankHonorScroll.SetLookIndex(index);
 }