Ejemplo n.º 1
0
    /// <summary>
    /// 处理View消息
    /// </summary>
    /// <param name="message"></param>
    public override void OnMessage(Message message)
    {
        string name = message.Name;

        object[] body = message.Params;
        switch (name)
        {
        case MessageConst.CMD_APPOINTMENT_ENSUREOPENGATE:
            _usergate        = (AppointmentGateRuleVo)body[0];
            _appointmentrule = (AppointmentRuleVo)body[1];

            //这里要判断卡牌和星级啊。从appointment中获取到。
            var cardvo = GlobalData.CardModel.GetUserCardById(_appointmentrule.ActiveCards[0]);
            if (cardvo.Star < _usergate.Star)
            {
                //Debug.LogError("cstar"+cardvo.Star+"  userstar"+_usergate.Star);
                FlowText.ShowMessage(I18NManager.Get("LoveAppointment_Hint3"));    //("星缘心级不足");
                return;
            }

            if ((int)cardvo.Evolution < _usergate.Evo)
            {
//					Debug.LogError("(int)cardvo.Evolution"+(int)cardvo.Evolution+" _usergate.Evo"+_usergate.Evo);
                FlowText.ShowMessage(I18NManager.Get("LoveAppointment_Hint4"));                        //("星缘未进化");
                return;
            }



            if (_ensureOpenGateWindow == null)
            {
                _ensureOpenGateWindow = PopupManager.ShowWindow <EnsureOpenGateWindow>("LoveAppointment/Prefabs/EnsureOpenGateWindow");
            }
            _ensureOpenGateWindow.SetData(_usergate, _appointmentrule.Id);

            //bug 这个事件监听在Start的时候无法执行。
            EventDispatcher.AddEventListener(EventConst.OpenGate, OpenGate);

            break;

//			case MessageConst.CMD_APPOINTMENT_UPDATE_LOVESTORY:
//
//				UpdateAppointmentData();
//				break;
        case MessageConst.CMD_APPOINTMENT_ACTIVE_PHOTOCLEARUP:
            PhotoNickUpReq((int)body[0], (int)body[1]);
            break;

        case MessageConst.CMD_APPOINTMENT_JUMPTODAILY:

            if (!GuideManager.IsOpen(ModulePB.Love, FunctionIDPB.LoveDiary))
            {
                string desc = GuideManager.GetOpenConditionDesc(ModulePB.Love, FunctionIDPB.LoveDiary);
                FlowText.ShowMessage(desc);
                return;
            }
            ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_LOVEDIARY, false);
            break;
        }
    }
Ejemplo n.º 2
0
        private void LoveStep3()
        {
            stroyList.gameObject.SetActive(false);
            pointarrow.gameObject.SetActive(false);

            storyview.gameObject.SetActive(true);
            GuideArrow.DoAnimation(storyview.Find("Stage/Circle"));
//            var arrow = storyview.Find("Stage/Circle/Arrow").GetComponent<Image>();
//            RectTransform rect = arrow.rectTransform;
//            rect.DOLocalMove(new Vector2(rect.localPosition.x + 30.0f,
//                rect.localPosition.y + 30.0f), 0.5f).SetLoops(-1, LoopType.Yoyo);
            PointerClickListener.Get(storyview.Find("Stage/Circle/ClickArea").gameObject).onClick = go =>
            {
                //进入想要去的剧情!//good!//需要,gate和vo
                var gate = new AppointmentGateRuleVo(_appointmentRuleVo.GateInfos[0]);
//                SendMessage(new Message(MessageConst.CMD_APPOINTMENT_ENSUREOPENGATE,
//                    Message.MessageReciverType.UnvarnishedTransmission,gate,_appointmentRuleVo));
                _cacheVo = CacheManager.CheckLoveStoryCache(_userCardVo.CardId);
                if (_cacheVo != null && _cacheVo.needDownload)
                {
                    CacheManager.DownloadLoveStoryCache(_userCardVo.CardId, str =>
                    {
                        ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_STORY, false, false, gate, _appointmentRuleVo.Id);
                    }, null, str =>
                    {
                        Debug.LogError("Cancle?!");
                        ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_STORY, false, false, gate, _appointmentRuleVo.Id);
                    });
                    Debug.LogError("download");
                }
                else
                {
                    ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_STORY, false, false, gate, _appointmentRuleVo.Id);
                }
                gameObject.Hide();
            };
        }