Beispiel #1
0
        public void ItemClick()
        {
            if (itemList != null)
            {
                var itemData = itemList.Item as BagItemDataModel;

                if (itemData.ItemId != -1)
                {
                    var tbItem = Table.GetItemBase(itemData.ItemId);
                    ///宝箱类型特殊处理
                    if (tbItem.Type != 23500)
                    {
                        var e = new PackItemClickEvent();
                        e.BagId   = itemData.BagId;
                        e.Index   = itemList.Index;
                        e.TableId = itemData.ItemId;
                        EventDispatcher.Instance.DispatchEvent(e);
                    }
                    else
                    {
                        if (UIManager.GetInstance().GetController(UIConfig.ChestInfoUI).State == FrameState.Open)
                        {
                            var e = new PackItemClickEvent();
                            e.BagId   = itemData.BagId;
                            e.Index   = itemList.Index;
                            e.TableId = itemData.ItemId;
                            EventDispatcher.Instance.DispatchEvent(e);
                        }
                        else
                        {
                            var e = new UIEvent_ClickChest(itemData.ItemId);
                            //e.Args.Tab = itemData.ItemId;
                            e.From         = "Bag";
                            e.BagDataModel = itemData;
                            EventDispatcher.Instance.DispatchEvent(e);
                        }
                    }

                    //var e = new PackItemClickEvent();
                    //e.BagId = itemData.BagId;
                    //e.Index = itemList.Index;
                    //EventDispatcher.Instance.DispatchEvent(e);
                }
                else
                {
                    if (itemData.Status == (int)eBagItemType.Lock || itemData.Status == (int)eBagItemType.FreeLock)
                    {
                        var e = new PackUnlockEvent(itemData);
                        EventDispatcher.Instance.DispatchEvent(e);
                    }
                }
            }
        }
Beispiel #2
0
        //点击队伍玩家头像
        public void OnClick_HeadIcon(int index)
        {
            var parent = UIManager.GetInstance().GetUIRoot(UIType.TYPE_TIP);

            UIConfig.OperationList.Loction =
                parent.transform.InverseTransformPoint(TeamMemberCellLogics[index].ModelView.transform.position);
            UIConfig.OperationList.Loction.x += -150;
            UIConfig.OperationList.Loction.y += -20;
            UIConfig.OperationList.Loction.z  = 0;
            var e = new TeamMemberShowMenu(index);

            EventDispatcher.Instance.DispatchEvent(e);
        }
Beispiel #3
0
        //点击模型
        public void OnClick_Model(int index)
        {
            var parent = UIManager.GetInstance().GetUIRoot(UIType.TYPE_TIP);

            UIConfig.OperationList.Loction = parent.transform.worldToLocalMatrix *
                                             TeamMemberCellLogics[index].ModelView.worldCenter;
            UIConfig.OperationList.Loction.x += 64;
            UIConfig.OperationList.Loction.y += 100;
            UIConfig.OperationList.Loction.z  = 0;
            var e = new TeamMemberShowMenu(index);

            EventDispatcher.Instance.DispatchEvent(e);
        }
Beispiel #4
0
        public void OnClickFriendInfo()
        {
            var data = ItemLogic.Item as FriendInfoDataModel;

            if (data == null)
            {
                return;
            }

            var parent = UIManager.GetInstance().GetUIRoot(UIType.TYPE_TIP);

            UIConfig.OperationList.Loction    = parent.transform.InverseTransformPoint(FaceIcon.transform.position); //parent.transform.worldToLocalMatrix*FaceIcon.worldCenter;
            UIConfig.OperationList.Loction.x += 64;
            UIConfig.OperationList.Loction.y += 100;
            UIConfig.OperationList.Loction.z  = 0;
            var e = new FriendClickShowInfo(data);

            EventDispatcher.Instance.DispatchEvent(e);
        }
Beispiel #5
0
        public void OnClickLand(PlowLandFrame land)
        {
            if (land == null)
            {
                return;
            }
            land.OnClickLand();
            if (mTouchingFarmLand != null)
            {
                //mTouchingFarmLand = null;
                return;
            }
            MatureTimeBg.gameObject.SetActive(false);
            if (mMatureTimer != null)
            {
                StopCoroutine(mMatureTimer);
                mMatureTimer = null;
            }
            mMatureScend = 0;
            if (land.DataModel.State == (int)LandState.Lock)
            {
                //这块土地还未开垦,请提升农场等级!
                var e1 = new ShowUIHintBoard(300302);
                EventDispatcher.Instance.DispatchEvent(e1);
                return;
            }
            var parent = UIManager.GetInstance().GetUIRoot(UIType.TYPE_TIP);
            var loc    = parent.transform.worldToLocalMatrix * land.LockSprite.worldCenter;

            loc.x -= 100;
            loc.y += 70;
            loc.z  = -300;
            LandMenu.transform.localPosition  = loc;
            LandMenu.transform.localPosition += new Vector3(-80, 0, 0);
            SpringPanel.Stop(MenuObject.gameObject);
            ResetScrollViewPostion();
            EventDispatcher.Instance.DispatchEvent(new FarmLandCellClick(land.DataModel.Index, false));
            mTouchingFarmLand = land;
            DragState         = LandDragState.Invalid;
        }
Beispiel #6
0
        public void ItemClick()
        {
            var conler   = UIManager.Instance.GetController(UIConfig.BackPackUI);
            var packType = "";

            if (conler != null)
            {
                packType = conler.CallFromOtherClass("GetPackType", null).ToString();
            }

            if (itemList != null)
            {
                var itemData = itemList.Item as BagItemDataModel;

                if (itemData.ItemId != -1)
                {
                    var tbItem = Table.GetItemBase(itemData.ItemId);

                    ///时装特殊处理
                    if (tbItem.Type == 10500 || tbItem.Type == 10501 || tbItem.Type == 10502)
                    {
                        var e = new ShiZhuangItemUseEvent();
                        e.ItemData = itemData;
                        EventDispatcher.Instance.DispatchEvent(e);
                        return;
                    }

                    ///宝箱类型特殊处理
                    if (tbItem.Type != 23500)
                    {
                        var e = new PackItemClickEvent();
                        e.BagId   = itemData.BagId;
                        e.Index   = itemList.Index;
                        e.TableId = itemData.ItemId;
                        EventDispatcher.Instance.DispatchEvent(e);
                    }
                    else
                    {
                        if (UIManager.GetInstance().GetController(UIConfig.ChestInfoUI).State == FrameState.Open)
                        {
                            var e = new PackItemClickEvent();
                            e.BagId   = itemData.BagId;
                            e.Index   = itemList.Index;
                            e.TableId = itemData.ItemId;
                            EventDispatcher.Instance.DispatchEvent(e);
                        }
                        else if (packType == "Depot")
                        {
                            var e = new PackItemClickEvent();
                            e.BagId   = itemData.BagId;
                            e.Index   = itemList.Index;
                            e.TableId = itemData.ItemId;
                            EventDispatcher.Instance.DispatchEvent(e);
                        }
                        else
                        {
                            Debug.Log(packType.ToString());
                            var e = new UIEvent_ClickChest(itemData.ItemId);
                            //e.Args.Tab = itemData.ItemId;
                            e.From         = "Bag";
                            e.BagDataModel = itemData;
                            EventDispatcher.Instance.DispatchEvent(e);
                        }
                    }

                    //var e = new PackItemClickEvent();
                    //e.BagId = itemData.BagId;
                    //e.Index = itemList.Index;
                    //EventDispatcher.Instance.DispatchEvent(e);
                }
                else
                {
                    if (itemData.Status == (int)eBagItemType.Lock || itemData.Status == (int)eBagItemType.FreeLock)
                    {
                        var e = new PackUnlockEvent(itemData);
                        EventDispatcher.Instance.DispatchEvent(e);
                    }
                }
            }
        }
Beispiel #7
0
        private void CheckRequirement()
        {
            var conllor = UIManager.GetInstance().GetController(UIConfig.MissionTrackList);

            if (conllor == null)
            {
                return;
            }

            var data = conllor.GetDataModel("") as MissionTrackListDataModel;

            if (data == null)
            {
                return;
            }

            if (EnableGameObject1 != null)
            {
                EnableGameObject1.SetActive(false);
                if (data.List[0].state == (int)eMissionState.Finished)
                {
                    EnableGameObject1.SetActive(true);
                }
            }
            if (EnableGameObject2 != null)
            {
                EnableGameObject2.SetActive(false);
                if (data.List[1].state == (int)eMissionState.Finished)
                {
                    EnableGameObject2.SetActive(true);
                }
            }
            if (EnableGameObject3 != null)
            {
                EnableGameObject3.SetActive(false);
                if (data.List[2].state == (int)eMissionState.Finished)
                {
                    EnableGameObject3.SetActive(data.List[2].state == (int)eMissionState.Finished);
                }
            }
            if (EnableGameObject4 != null)
            {
                EnableGameObject4.SetActive(false);
                if (data.List[3].state == (int)eMissionState.Finished)
                {
                    EnableGameObject4.SetActive(data.List[3].state == (int)eMissionState.Finished);
                }
            }

            if (NoticeObject != null)
            {
                NoticeObject.SetActive(false);

                var mainMission = data.List[0];
                var enumerator  = Condition.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    var condition = enumerator.Current;
                    if (mainMission.MissionId == condition.MissionId &&
                        condition.State == (eMissionState)mainMission.state)
                    {
                        NoticeObject.SetActive(true);
                        break;
                    }
                }
            }
        }