Example #1
0
 private void OnGetOrderError(HttpErrorVo vo)
 {
     Debug.LogError("IOS创建订单失败回调---》" + vo.ErrorCode);
     LoadingOverlay.Instance.Hide();
     FlowText.ShowMessage(I18NManager.Get("Shop_Hint2", vo.ErrorCode)); // ("创建订单失败" + "->" + vo.ErrorCode);
 }
 /// <summary>
 /// 刷新累计签到显示
 /// </summary>
 public void RefreshAccumulativeSignin(int signNum, int isGet, int totalDate)
 {
     _curAccumulateSigninDayTxt.text = I18NManager.Get("Activity_Hint6", GlobalData.ConfigModel.GetConfigByKey(GameConfigKey.MONTH_SIGN_RESET_DAY), signNum);
     CheckGetAccumulativeAward(signNum, isGet, totalDate);
 }
Example #3
0
 private void OnChangeRole(MapField <int, int> apparel)
 {
     view.SetRoleBg(apparel[0]);
     FlowText.ShowMessage(I18NManager.Get("FavorabilityMain_SucceedShow"));
 }
Example #4
0
 private void Level2_4Fail()
 {
     GoToNextGuideStage(I18NManager.Get("Guide_MainLineDrawCard"));
     // PopupManager.CloseLastWindow();
 }
Example #5
0
 private void Level2_12End()
 {
     gameObject.Show();
     GuideManager.SetPassLevelStep("2-12");
     GoToNextGuideStage(I18NManager.Get("Guide_MainLineLoveDiary"));
 }
Example #6
0
 private void Level4_12End()
 {
     GuideManager.GuideType = true;
     GoToNextGuideStage(I18NManager.Get("Guide_MainLine4_12End"));
     gameObject.Show();
 }
Example #7
0
 private void Level1_9End()
 {
     GuideManager.SetRemoteGuideStep(GuideTypePB.MainGuide, GuideConst.MainLineStep_Stroy1_9_Over);
     GoToNextGuideStage(I18NManager.Get("Guide_MainLine1_9"));
 }
    public void SetData(AwardPB pb)
    {
        Debug.Log(pb.ResourceId + " " + pb.Num + " " + pb.Resource);
        //transform.Find("ItemImg").GetComponent<Image>();
        //transform.Find("ItemNumTxt").GetComponent<Text>().text="X " + awardPB.Num;

        string path = "";
        string name = "";

        if (pb.Resource == ResourcePB.Item)
        {
            name = GlobalData.PropModel.GetPropBase(pb.ResourceId).Name;
        }
        else
        {
            name = ViewUtil.ResourceToString(pb.Resource);
        }

        if (pb.Resource == ResourcePB.Gold)
        {
            //  vo.OwnedNum = (int)GlobalData.PlayerModel.PlayerVo.Gold;
            path = "Prop/particular/" + PropConst.GoldIconId;
        }
        else if (pb.Resource == ResourcePB.Gem)
        {
            path = "Prop/particular/" + PropConst.GemIconId;
        }
        else if (pb.Resource == ResourcePB.Power)
        {
            path = "Prop/particular/" + PropConst.PowerIconId;
        }
        else if (pb.Resource == ResourcePB.Card)
        {
            path = "Head/" + pb.ResourceId;

            CardPB cpb = GlobalData.CardModel.GetCardBase(pb.ResourceId);
            name = CardVo.SpliceCardName(cpb.CardName, cpb.Player);
        }
        else if (pb.Resource == ResourcePB.Memories)
        {
            path = "Prop/particular/123456789";
        }
        else
        {
            path = "Prop/" + pb.ResourceId;
        }
        _propImage   = transform.Find("PropImage").GetComponent <RawImage>();
        _propNameTxt = transform.Find("PropNameTxt").GetComponent <Text>();
        _ownTxt      = transform.Find("ObtainText").GetComponent <Text>();


        _propImage.texture = ResourceManager.Load <Texture>(path);
        _propNameTxt.text  = name;
        _ownTxt.text       = I18NManager.Get("GameMain_ActivityAwardItemObtainText", pb.Num);
        if (pb.Resource != ResourcePB.Card)
        {
            GameObject clickObj = transform.Find("ItemBg").gameObject;
            clickObj.transform.GetComponent <Image>().raycastTarget = true;
            PointerClickListener.Get(clickObj).onClick =

                //UIEventListener.Get(clickObj).onClick =
                go => { FlowText.ShowMessage(ClientData.GetItemDescById(pb.ResourceId, pb.Resource).ItemDesc); };
        }
        // _propImage.SetNativeSize();
    }
Example #9
0
 private void OnBtnRuleTipsClick()
 {
     PopupManager.ShowCommonRuleWindow(I18NManager.Get("ActivityTemplate_ActivityTemplateRule_Content"), I18NManager.Get("ActivityTemplate_ActivityTemplateRule_Tittle"));
 }
Example #10
0
    private void EvoJump(int evostage, PlayerPB curplayer)
    {
        var tipsWindow = PopupManager.ShowConfirmWindow(evostage == 1 ? I18NManager.Get("Card_HasSomeWordToSay") : I18NManager.Get("Card_HasSomeWordToSay2"),
                                                        evostage == 1 ? I18NManager.Get("Card_UnlockNewVoice") : I18NManager.Get("Card_UnlockCloth"), evostage == 1 ? I18NManager.Get("Card_ToSee") : I18NManager.Get("Card_ToLook"));

        tipsWindow.CanClickBGMask       = false;
        tipsWindow.WindowActionCallback = evt =>
        {
            if (evt == WindowEvent.Ok)
            {
                //跳转到目标窗口!
                if (evostage == 1)
                {
                    Debug.LogError("jump to voice");
                    ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_FAVORABILITYMAIN, false, false, "Voice", curplayer);
                }
                else if (evostage == 3)
                {
                    Debug.LogError("jump to cloth");
                    GlobalData.FavorabilityMainModel.CurrentRoleVo = GlobalData.FavorabilityMainModel.GetUserFavorabilityVo((int)curplayer);
                    ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_RELOADING, false, true);
                }
            }
        };
    }
Example #11
0
    public override void OnMessage(Message message)
    {
        string name = message.Name;

        object[] body = message.Params;
        switch (name)
        {
        case MessageConst.CMD_BATTLE_SET_POWER:
            SetProgress((int)body[0], MaxPower);
            _battleCommon.Show();
            _model.IsGetBattleResult = true;
            ClientTimer.Instance.DelayCall(OnBattleResult, 1f);
            break;

        case MessageConst.CMD_BATTLE_CHANGE_POWER:
            _battleCommon.Show();
            Power += (int)body[0];
//                Debug.LogError("进度条增加的值==="+Power);
            SetProgress(Power, MaxPower);
            break;

        case MessageConst.CMD_BATTLE_SHOW_SUPPORTER_VIEW:
            _supporterPanel = new SupporterPanel();
            _supporterPanel.Init(this);
            _supporterPanel.Show(0);
            _currentPanel = _supporterPanel;
            break;

        case MessageConst.CMD_BATTLE_NEXT:
            if (_currentPanel == _supporterPanel)
            {
                //  _battleCommon.Hide();
                //显示广场和粉丝动画
                _currentPanel.Destroy();

                Queue <string> fansInfo  = (Queue <string>)body[0];
                int            tempPower = (int)body[1];
                _battlePanel.GetFansInfo(fansInfo);
                _battlePanel.GetPower(tempPower);
                _currentPanel = _battlePanel;
            }
            else if (_currentPanel == _battlePanel)
            {
                _superStarPanel = new SuperStarPanel();
                _superStarPanel.Init(this);
                _superStarPanel.Show(0);
                _currentPanel = _superStarPanel;
                _battleCommon.Hide();
            }
            break;


        case MessageConst.CMD_BATTLE_SUPERSTAR_CONFIRM:
            _model.IsShowingAnimation = true;
            _superStarPanel.Hide();
            _battleCommon.Show();
            Power += (int)body[0];
            SetProgress(Power, MaxPower);

            break;

        case MessageConst.CMD_BATTLE_SHOW_REWARD:
            _currentPanel.Destroy();
            _currentPanel = new FinalEstimateRewardPanel();
            _currentPanel.Init(this);

            _battleFinalBg.Show();
            _battleCommon.Hide();
            _battleFinalBg.transform.SetSiblingIndex(0);
            break;

        case MessageConst.CMD_BATTLE_FINISH:
//                if(body != null && body.Length > 0)
//                {
//                    string moduleName = (string) body[0];
//                    ModuleManager.Instance.EnterModule(moduleName);
//                }
//                else
//                {
//                    ModuleManager.Instance.GoBack();
//                }
            ClientTimer.Instance.DelayCall(() =>
            {
                if (body != null && body.Length > 0)
                {
                    string moduleName = (string)body[0];
                    ModuleManager.Instance.EnterModule(moduleName);
                }
                else
                {
                    //
                    ModuleManager.Instance.GoBack();
                }
            }, 0.3f);

            break;

        case MessageConst.CMD_BATTLE_RESTART:
            if (_model.LevelVo.CostEnergy > GlobalData.PlayerModel.PlayerVo.Energy)
            {
                FlowText.ShowMessage(I18NManager.Get("MainLine_BattleIntroductionPopupHint1"));
            }
            else
            {
                Reset();
            }
            break;

        case MessageConst.CMD_BATTLE_FANS_CALL_ANIMATION_FINISH:
            _model.IsShowingAnimation = false;
            OnBattleResult();
            break;

        case MessageConst.CMD_BATTLE_SEND_ROLE_ID:

            roleIds = (Queue <int>)body[0];


            break;

        case MessageConst.CMD_BATTLE_GET_RES:
            _battleCommon.Hide();
            _battlePanel.HideBackBtn();
            _battlePanel.GetRolesId(roleIds);
            break;

        case MessageConst.CMD_BATTLE_HIDE_PROGRESS:
            _battleCommon.Hide();
            break;
        }
    }
Example #12
0
    private void OnEvolution(EvolutionRes res)
    {
        LoadingOverlay.Instance.Hide();
        UpdateUserCard(res.UserCard);
        GlobalData.PlayerModel.UpdateUserMoney(res.UserMoney);
        GlobalData.CardModel.UpdateUserCards(new[] { res.UserCard });
        //Debug.LogError(res.UserItems.Count);
        GlobalData.PropModel.UpdateProps(res.UserItems);
        FlowText.ShowMessage(I18NManager.Get("Card_EvolutionSuccess"));
        AudioManager.Instance.PlayEffect("evolve", 1);
        //view.ShowEvolution();
        if (_evolutionWindow != null)
        {
            //_evolutionWindow.SetData(GlobalData.CardModel.CurCardVo);
            _evolutionWindow.Close();
        }

        switch (res.UserCard.Evolution)
        {
        case EvolutionPB.Evo0:
            break;

        case EvolutionPB.Evo1:
            //弹出弹窗显示看一看

            //新获得语音写入缓存
            List <ElementPB> elementPBs = GlobalData.DiaryElementModel.GetDialogsByCardId(res.UserCard.CardId);
            foreach (var v in elementPBs)
            {
                Debug.LogError(" v id => " + v.Id);
                GlobalData.DiaryElementModel.UpdateElement(v.Id, 1);
                string storeKey = Constants.REDPOINT_YUYINSHOUCANG + v.Id;
                Util.SetIsRedPoint(storeKey, true);
            }

            if (elementPBs.Count > 0)
            {
                EvoJump(1, GlobalData.CardModel.GetUserCardById(res.UserCard.CardId).CardVo.Player);
            }

            break;

        case EvolutionPB.Evo2:
            //这里要播放动画啊!
            view.SetEvoEffect();
            Debug.Log("Can change cardface");
            break;

        case EvolutionPB.Evo3:
            //EvoJump(3, GlobalData.CardModel.GetUserCardById(res.UserCard.CardId).CardVo.Player);
            break;
        }

        if (GlobalData.MissionModel.IsHaveStarActivityMission)
        {
            GlobalData.MissionModel.MissionAttainmentModel.TriggerPopWindow(MissionAttainmentModel.StarActivityPopUpsType.CardEvolutionUp, (int)res.UserCard.Evolution);
        }

        //此刻控制特效出现。
        EventDispatcher.TriggerEvent(EventConst.ShowStoreScore);
        SdkHelper.StatisticsAgent.OnEvent("进化次数", Convert.ToInt32(res.UserCard.Evolution));
    }
Example #13
0
    private void ShowCardAwardPreview(UserCardVo userCardVo)
    {
        List <CardAwardPreInfo> infos = new List <CardAwardPreInfo>();
        var vo     = userCardVo;
        int cardId = userCardVo.CardId;
        int NpcId  = (int)userCardVo.CardVo.Player;

        var userFavorabilityVo = GlobalData.FavorabilityMainModel.GetUserFavorabilityVo(NpcId);//用户NPC的好感度信息

        Debug.LogError("CardId " + cardId + "  NpcId " + NpcId);

        PlayerPB playerPB = userCardVo.CardVo.Player;

        var cardPd = GlobalData.CardModel.GetCardBase(cardId);

        for (int i = 0; i < cardPd.GainSceneIds.Count; i++)
        {
            int phonesceneId = cardPd.GainSceneIds[i];
            if (phonesceneId == 0)
            {
                continue;
            }
            bool isUnlock = true;

            var userCard = GlobalData.CardModel.GetUserCardById(cardId);
            isUnlock = userCard != null;

            //   Debug.LogError("phonesceneId" + phonesceneId+ "GetSceneName"+ GetSceneName(phonesceneId));

            CardAwardPreInfo info = CreateCardAwardPreInfo(GetSceneName(phonesceneId), isUnlock, GetCardAwardPreType(phonesceneId));

            info.StartTips = "1心解锁.";
//            Debug.LogError(isUnlock+" "+info.content);
            infos.Add(info);
        }



        int sceneId = 0;

        //解锁手机事件
        for (int i = 0; i < vo.MaxStars; i++)
        {
            var targetStarUpPb = GlobalData.CardModel.GetCardStarUpRule(vo.CardId, (StarPB)i);
            if (targetStarUpPb == null)
            {
                //Debug.LogError("no i" + i);
                continue;
            }
            for (int j = 0; j < targetStarUpPb.SceneIds.Count; j++)
            {
                if (targetStarUpPb.SceneIds[j] == 0)
                {
                    continue;
                }
                sceneId = targetStarUpPb.SceneIds[j];
                bool isUnlock = false;
                SceneUnlockRulePB curscenePb = GlobalData.FavorabilityMainModel.GetUnlockRulePb(sceneId);
                if (curscenePb == null)
                {
                    continue;
                }
                if (curscenePb.FavorabilityLevel <= userFavorabilityVo.Level && (int)targetStarUpPb.Star <= vo.Star)
                {
                    isUnlock = true;
                }
                if (curscenePb != null)
                {
                    //SmsInfo info = JsonConvert.DeserializeObject<SmsInfo>(text);
                    CardAwardPreInfo info        = CreateCardAwardPreInfo(GetSceneName(sceneId), isUnlock, GetCardAwardPreType(sceneId));
                    PhoneUnlockInfo  phoneUnlock = ClientData.GetPhoneUnlockInfoById(sceneId);
                    if (phoneUnlock != null)
                    {
                        info.UnlockDescription = phoneUnlock.UnlcokDes;
                        info.StartTips         = phoneUnlock.StartTips + ".";
                        Debug.LogError(info.content);
                        infos.Add(info);
                    }
                }
                Debug.Log("Star  level " + i + "  sceneID  " + sceneId + "  isUnlock " + isUnlock);
            }
        }


        //恋爱剧情
        UserAppointmentVo userAppointmentVo = GlobalData.AppointmentData.GetCardAppointmentVo(cardId);

        if (userAppointmentVo != null)
        {
            int appointmentId = userAppointmentVo.AppointmentId;
            AppointmentRuleVo appointmentRuleVo = GlobalData.AppointmentData.GetAppointmentRule(appointmentId);

            string cotent = appointmentRuleVo.Name;

            foreach (var v in appointmentRuleVo.GateInfos)
            {
                //cotent = cotent + v.Gate.ToString();

                bool isUnlock = userAppointmentVo.ActiveGateInfos.Contains(v.Gate);
                if (v.Star == 0 && v.Evo == 0)
                {
                    isUnlock = true;
                }


                string key  = "Common_Number" + v.Gate.ToString();
                var    info = CreateCardAwardPreInfo(cotent + I18NManager.Get(key), isUnlock, CardAwardPreType.LoveStory);

                if (v.Star == 0 && v.Evo == 0)
                {
                    info.StartTips = "1心解锁.";
                }


                if (v.Star > 0)
                {
                    info.StartTips         = (v.Star + 1) + "心解锁.";
                    info.UnlockDescription = I18NManager.Get("Card_PreviewStarUnlock", (v.Star + 1));
                }

                if (v.Evo > 0)
                {
                    info.StartTips         = "进化" + v.Evo + "解锁.";
                    info.UnlockDescription = I18NManager.Get("Card_PreviewEvoUnlock", v.Evo);
                }

                infos.Add(info);
            }
        }

        //日记语音
        List <ElementPB> elementPBs = GlobalData.DiaryElementModel.GetDialogsByCardId(cardId);

        foreach (var elementPB in elementPBs)
        {
            if (elementPB.ElementType == ElementTypePB.Sound)
            {
                string cotent   = elementPB.Name;
                bool   isUnlock = GlobalData.DiaryElementModel.IsCanUseElement(elementPB.Id);
                var    info     = CreateCardAwardPreInfo(cotent, isUnlock, CardAwardPreType.LoveDiaryLabelVoice);
                info.StartTips         = "进化1解锁.";
                info.UnlockDescription = I18NManager.Get("Card_PreviewEvoUnlock", 1);
                infos.Add(info);
            }
        }

//        var drawcards = ClientData.GetDrawCardExpressionInfos(NpcId, EXPRESSIONTRIGERTYPE.DRAWCARD);
//        //抽卡语音
//        foreach (var v in drawcards)
//        {
//            string cotent = v.DialogName;
//            bool isUnlock = true;
//            infos.Add(CreateCardAwardPreInfo(cotent, isUnlock, CardAwardPreType.DrawCardVioce));
//        }

        infos.Sort();

        string cardName = userCardVo.CardVo.CardName;
        var    win      = PopupManager.ShowWindow <CardAwardPreviewWindow>("Card/Prefabs/CardDetail/CardAwardPreviewWindow");

        win.SetData(cardName, infos);

        //string path = "FavorabilityMain/Prefabs/VoiceWindow";
        //var voiceWin = PopupManager.ShowWindow<VoiceWindow>(path);
        //voiceWin.SetData("111", infos);
    }
Example #14
0
        private void OnNextStep(GameObject go)
        {
            if (Time.realtimeSinceStartup - _lastClickTime < 1f)
            {
                return;
            }

            //这个是错的,应该是点击完才移除刷新!

            Debug.LogError(_step);
            switch (_step)
            {
            case 2:
                _bg.DOColor(new Color(0, 0, 0, 0), 0.3f);

                //_highlight.GetImage().color = new Color(1, 1, 1, 0.5f);
                //_highlight.gameObject.Show();
                //_highlight.GetImage().DOColor(Color.white, 0.5f).SetLoops(-1, LoopType.Yoyo);

//                    transform.RemoveComponent<PointerClickListener>();
                pos2 = transform.GetRectTransform("Viewport/Content/ActivityItem/HasSupport/Step2");
                pos2.gameObject.Show();
                if (!hasPlaypos2)
                {
                    hasPlaypos2 = true;
                    GuideArrow.DoAnimation(pos2);
                }

//                    _highlight.transform.SetParent(pos2.transform.parent, false);
//                    _highlight.CopyRectTransform(pos2);
//
//                    _lightTweener=_highlight.DOLocalMoveX(_highlight.localPosition.x+10,0.5f).SetLoops(-1, LoopType.Yoyo);
                RectTransform gv2 = transform.GetRectTransform("GuideView2");
                _guideView.CopyRectTransform(gv2);

                gv2.SetNormalPivot();

                _guideText.text = I18NManager.Get("Guide_SupporterActGuideViewHint2");

                //这个需要点击到了那个可点击区域才可以下一步            _step++;!
                //_clickArea =PointerClickListener.Get();//_highlight.gameObject
                _stepListen2 = transform.Find("Viewport/Content/ActivityItem/HasSupport/Step2Listener").GetButton();
                _stepListen2.onClick.RemoveAllListeners();
                _stepListen2.onClick.AddListener(() =>
                {
//                        SendMessage(new Message(MessageConst.CMD_SUPPORTERACTIVITY_GUIDETOFANSMODULE,Message.MessageReciverType.UnvarnishedTransmission));
//                        EnterActivity();
                    SendMessage(new Message(MessageConst.MOUDLE_GUIDE_STEP_REMOTE, Message.MessageReciverType.DEFAULT, GuideTypePB.EncourageActGuide, 1020)); //新手引导ID??
                    _stepListen2.onClick.RemoveAllListeners();
                    _step += 2;
                });
                break;

            case 3:
                Debug.LogError("wrong");
                break;

            case 4:
                pos3.gameObject.Hide();
                pos4 = transform.GetRectTransform("SupporterProps/SupporterPropList/PropItem2/Step4");
//                    _highlight.transform.SetParent(pos4.transform.parent, false);
//                    _highlight.CopyRectTransform(pos4);
                pos4.gameObject.Show();

                if (!hasPlaypos4)
                {
                    hasPlaypos4 = true;
                    GuideArrow.DoAnimation(pos4);
                }

                RectTransform gv4 = transform.GetRectTransform("GuideView4");
                _guideView.CopyRectTransform(gv4);

                gv4.SetNormalPivot();

//                    _highlight.GetImage().raycastTarget = false;
//
//                    _lightTweener.Kill();
//                    _lightTweener=_highlight.DOLocalMoveX(_highlight.localPosition.x+10,0.5f).SetLoops(-1, LoopType.Yoyo);

                _guideText.text = I18NManager.Get("Guide_SupporterActGuideViewHint3");
                _step++;
                break;

            case 5:
                pos4.gameObject.Hide();
                pos5 = transform.GetRectTransform("GoBtn/Step5");
//                    _highlight.transform.SetParent(pos5.transform.parent, false);
//                    _highlight.CopyRectTransform(pos5);
                pos5.gameObject.Show();
                if (!hasPlaypos5)
                {
                    hasPlaypos5 = true;
                    GuideArrow.DoAnimation(pos5);
                }

                RectTransform gv5 = transform.GetRectTransform("GuideView5");
                _guideView.CopyRectTransform(gv5);

//                    _lightTweener.Kill();
//                    _lightTweener=_highlight.DOLocalMoveX(_highlight.localPosition.x+10,0.5f).SetLoops(-1, LoopType.Yoyo);

                gv5.SetNormalPivot();


                _guideText.text = I18NManager.Get("Guide_SupporterActGuideViewHint4");
//                    _highlight.GetImage().raycastTarget = true;
                //这一步很关键,需要跟网络通讯!
                //_step++;
                var gobtn = transform.Find("GoBtn/Step5Listener").GetButton();  //_highlight.gameObject
                gobtn.onClick.RemoveAllListeners();
                gobtn.onClick.AddListener(() =>
                {
//                        Debug.LogError("Come!");
//                        SendMessage(new Message(MessageConst.CMD_SUPPORTERACTIVITY_GOBACK,Message.MessageReciverType.UnvarnishedTransmission));
//                        StartActSuccess();
                    SendMessage(new Message(MessageConst.CMD_SUPPORTERACTIVITY_GUIDETODOINGACT, Message.MessageReciverType.UnvarnishedTransmission));
                });
                break;

//                case 6:
//                    StartActSuccess();
//                    break;
            default:

                transform.RemoveComponent <PointerClickListener>();

                SendMessage(new Message(MessageConst.MOUDLE_GUIDE_END_SERVER, ModuleConfig.MODULE_SUPPORTERACTIVITY));
                break;
            }



            _lastClickTime = Time.realtimeSinceStartup;
        }
Example #15
0
    public override void OnMessage(Message message)
    {
        string name = message.Name;

        switch (name)
        {
        case MessageConst.CMD_DRAWCARD_GEM_DRAW_TEN:
            if (!CheckIsDrawCard(DrawTypePB.ByGem10))
            {
                FlowText.ShowMessage(I18NManager.Get("DrawCard_Hint1"));
                return;
            }

            if (!CheckIsEnough(DrawTypePB.ByGem10))
            {
                //FlowText.ShowMessage(I18NManager.Get("DrawCard_Hint2"));
                View.BuyStarcard(null);
                //SendMessage(new Message(MessageConst.CMD_DRAWCARD_BUYSTARCARD));
                return;
            }
            DrawCard(false, true);
            break;

        case MessageConst.CMD_DRAWCARD_GEM_DRAW_ONCE:
            if (!CheckIsDrawCard(DrawTypePB.ByGem))
            {
                FlowText.ShowMessage(I18NManager.Get("DrawCard_Hint1"));

                return;
            }
            if (!CheckIsEnough(DrawTypePB.ByGem) && GetLeftDrawTime(DrawPoolTypePB.DrawPoolCommon, DrawTypePB.ByGem) >= 1)
            {
                //FlowText.ShowMessage(I18NManager.Get("DrawCard_Hint2"));
                //SendMessage(new Message(MessageConst.CMD_DRAWCARD_BUYSTARCARD));
                View.BuyStarcard(null);
                return;
            }
            DrawCard(true, true);
            break;

        case MessageConst.CMD_DRAWCARD_GOLD_DRAW_ONCE:
            if (!CheckIsDrawCard(DrawTypePB.ByGold))
            {
                FlowText.ShowMessage(I18NManager.Get("DrawCard_Hint1"));
                return;
            }
            if (!CheckIsEnough(DrawTypePB.ByGold) && GetLeftDrawTime(DrawPoolTypePB.DrawPoolCommon, DrawTypePB.ByGold) >= 1)
            {
                FlowText.ShowMessage(I18NManager.Get("DrawCard_Hint3"));
                return;
            }
            DrawCard(true, false);
            break;

        case MessageConst.CMD_DRAWCARD_GOLD_DRAW_TEN:
            if (!CheckIsDrawCard(DrawTypePB.ByGold10))
            {
                FlowText.ShowMessage(I18NManager.Get("DrawCard_Hint1"));
                return;
            }
            if (!CheckIsEnough(DrawTypePB.ByGold10))
            {
                FlowText.ShowMessage(I18NManager.Get("DrawCard_Hint3"));
                return;
            }
            DrawCard(false, false);
            break;

        case MessageConst.CMD_DRAWCARD_GOTO_GOLD_DRAW:
            Debug.LogError("CMD_DRAWCARD_GOTO_GOLD_DRAW");
            //View.ScrollingDisplay(false);
            View.SetTabBtnPage(DrawCardView.GOLD_UI);
            break;

        case MessageConst.CMD_DRAWCARD_ACTIVITY_DRAW_ONCE:
            DrawCardActivity(true);
            break;

        case MessageConst.CMD_DRAWCARD_ACTIVITY_DRAW_TEN:
            DrawCardActivity(false);
            break;
        }
    }
    /// <summary>
    /// 下载确认
    /// </summary>
    /// <returns></returns>
    private ConfirmWindow ConfirmDownload(double size)
    {
        string content = I18NManager.Get("CoaxSleep_DownloadConfirm", size);

        return(PopupManager.ShowConfirmWindow(content));
    }
Example #17
0
 private void OnShareSuccess(string data)
 {
     Debug.LogError("分享成功--------------->" + data);
     FlowText.ShowMessage(I18NManager.Get("Common_ShareSuccess"));
 }
Example #18
0
    private void OnSelectChapter(int index)
    {
        if (_levelModel.ChapterList[index].IsNormalOpen == false)
        {
            FlowText.ShowMessage(I18NManager.Get("Common_ChapterNotUnlock"));
            _dropdown.value = _currentChapterId - 1;
            return;
        }

        if (!_levelModel.ChapterList[index].IsSupporterLevelSatisfy)
        {
            // FlowText.ShowMessage("应援会 Lv." + _levelModel.NewNormalLevel?.DepartmentLevel + "解锁");
            FlowText.ShowMessage(I18NManager.Get("MainLine_Hint3", _levelModel.NewNormalLevel?.DepartmentLevel));
            _dropdown.value = _currentChapterId - 1;
            return;
        }

        _currentChapterId = index + 1;
        _currentChapter   = _levelModel.ChapterList[_currentChapterId - 1];

        IsShowDownloadBtn(_currentChapterId);

        int imageIndex = (_currentChapterId - 1) % 4 + 1;

        _calendar.texture   = ResourceManager.Load <Texture>("MainLine/calendar" + imageIndex, ModuleName);
        _dropdownImg.sprite = AssetManager.Instance.GetSpriteAtlas("UIAtlas_MainLine_" + imageIndex);
        _dropdownBg.sprite  = AssetManager.Instance.GetSpriteAtlas("UIAtlas_MainLine_dropdownBg" + imageIndex);

        _expression.sprite = AssetManager.Instance.GetSpriteAtlas("UIAtlas_MainLine_Expression" + (index % 12 + 1));

        _calendar.transform.RemoveChildren();

        Color color = Colors[index % 4];

        _prevChapterBtn.GetComponentInChildren <Text>().color = color;
        _nextChapterBtn.GetComponentInChildren <Text>().color = color;


        if (_currentChapter.NextChapterVo != null && _currentChapter.IsNormalPass && _currentChapter.NextChapterVo.LevelList[0].IsPass == false)
        {
            _newNextChapter.gameObject.SetActive(true);
        }
        else
        {
            _newNextChapter.gameObject.SetActive(false);
        }
//        foreach (var levelData in _levelModel.LocalDataList[index])
//        {
//            if (!string.IsNullOrEmpty(levelData.itemId))
//            {
//                Image tagImage = Instantiate(tagItem).transform.GetImage("Image");
//                tagImage.transform.parent.SetParent(_calendar.transform, false);
//                tagImage.sprite = AssetManager.Instance.GetSpriteAtlas(levelData.itemId);
//                tagImage.SetNativeSize();
//
//                tagImage.transform.parent.GetRectTransform().anchoredPosition = levelData.position;
//            }
//        }


        var battleItemPref = GetPrefab("MainLine/Prefabs/BattleItem");
        var storyItemPref  = GetPrefab("MainLine/Prefabs/StoryItem");

        _prevChapterBtn.gameObject.SetActive(_currentChapterId != 1);

        if (_currentChapter.NextChapterVo == null && _currentChapter.IsNormalPass)
        {
            _nextChapterBtn.gameObject.SetActive(true);
        }
        else if (_currentChapter.NextChapterVo != null && _currentChapter.NextChapterVo.IsNormalOpen)
        {
            _nextChapterBtn.gameObject.SetActive(true);
        }
        else
        {
            _nextChapterBtn.gameObject.SetActive(false);
        }

        //策划说不要这个地方了
        // _starText.text = _currentChapter.CurrentStar + "/" + _currentChapter.MaxStar;

        Transform item = null;

        foreach (var levelVo in _currentChapter.LevelList)
        {
            if (levelVo.IsPass == false && levelVo != _levelModel.NewNormalLevel)
            {
                continue;
            }

            if (levelVo.LevelType == LevelTypePB.Story)
            {
                //剧情
                item = Instantiate(storyItemPref).transform;
            }
            else if (levelVo.LevelType == LevelTypePB.Value)
            {
                //战斗
                item = Instantiate(battleItemPref).transform;
            }

            bool doAnimation = _levelModel.LastLevel != null &&
                               _levelModel.NewNormalLevel != null &&
                               _levelModel.NewNormalLevel.LevelId != _levelModel.LastLevel.LevelId &&
                               levelVo == _levelModel.NewNormalLevel;

            item.gameObject.AddComponent <CalendarItem>().SetData(levelVo, doAnimation);
            item.GetComponent <RectTransform>().anchoredPosition = levelVo.Positon;
            item.SetParent(_calendar.transform, false);
            PointerClickListener.Get(item.gameObject).onClick = OnCalendarItemClick;
        }

        _levelModel.LastLevel = _levelModel.NewNormalLevel;

        var tagItem = GetPrefab("MainLine/Prefabs/TagItem");

        if (_levelModel.NewNormalLevel != null && _levelModel.NewNormalLevel.ChapterGroup == _currentChapterId)
        {
            Image tagImage = Instantiate(tagItem).transform.GetImage("Image");
            tagImage.transform.parent.SetParent(_calendar.transform, false);

            tagImage.color = new Color(1, 1, 1, 0);
            tagImage.DOFade(1, 0.05f).SetDelay(0.6f);
            tagImage.transform.parent.GetRectTransform().anchoredPosition = _levelModel.NewNormalLevel.Positon;
        }

        if (_canvasGroup.alpha < 1)
        {
            _canvasGroup.alpha = 0.5f;
            _canvasGroup.DOFade(1, 0.2f);
        }
    }
Example #19
0
        private void Level1_4ToLevel2_3Stage()
        {
            var     levelModel = GlobalData.LevelModel;
            LevelVo level1_4   = levelModel.FindLevel("1-4");
            LevelVo level1_5   = levelModel.FindLevel("1-5");
            LevelVo level1_6   = levelModel.FindLevel("1-6");
            LevelVo level1_7   = levelModel.FindLevel("1-7");
            LevelVo level1_8   = levelModel.FindLevel("1-8");
            LevelVo level1_9   = levelModel.FindLevel("1-9");
            LevelVo level2_1   = levelModel.FindLevel("2-1");
            LevelVo level2_2   = levelModel.FindLevel("2-2");
            LevelVo level2_3   = levelModel.FindLevel("2-3");
            LevelVo level2_4   = levelModel.FindLevel("2-4");

            if (!level1_4.IsPass)
            {
                Click1_4("1-4");
            }
            else if (!level1_5.IsPass)
            {
                SetNpcHint(true, I18NManager.Get("Guide_MainLine1_5_Star"));
                GuideManager.SetPassLevelStep("1-4");
                OnClickLevel("1-5");
            }
            else if (!level1_6.IsPass)
            {
                GuideManager.SetPassLevelStep("1-5");
                OnClickLevel("1-6");
            }
            else if (!level1_7.IsPass)
            {
                GuideManager.SetPassLevelStep("1-6");
                OnClickLevel("1-7");
            }
            else if (!level1_8.IsPass)
            {
                GuideManager.SetPassLevelStep("1-7");
                OnClickLevel("1-8");
            }
            else if (!level1_9.IsPass)
            {
                GuideManager.SetPassLevelStep("1-8");
                OnClickLevel("1-9");
            }
            else if (level1_9.IsPass && level2_1.IsPass == false)
            {
                //引导点击下一章
                GuideManager.SetPassLevelStep("1-9");

                var curStage = GuideManager.CurStage();
                if (curStage == GuideStage.MainLineStep_Stroy1_9_Over)
                {
                    Level1_9End();
                }
                else if (levelModel.ActiveLevel.ChapterGroup == 1 && level2_1.IsPass == false)
                {
                    OnClickNextChapter();
                }
                else
                {
                    //开始引导第二章
                    OnClickLevel("2-1");
                }
            }
            else if (level2_1.IsPass && level2_2.IsPass == false)
            {
                OnClickLevel("2-2");
            }
            else if (level2_2.IsPass && level2_3.IsPass == false)
            {
                OnClickLevel("2-3");
            }
            else if (level2_3.IsPass && level2_4.IsPass == false)
            {
                OnClickLevel("2-4");
            }
        }
Example #20
0
    public override void OnMessage(Message message)
    {
        string name = message.Name;

        object[] body = message.Params;
        switch (name)
        {
        case MessageConst.CMD_VISIT_WEATHER_JUMP_CLICK:
            Debug.Log("CMD_VISIT_WEATHER_JUMP_CLICK");
            if (_curVisitVo.CurWeather == VISIT_WEATHER.Fine)
            {
                SendMessage(new Message(MessageConst.MODULE_VISIT_SHOW_LEVEL_PANEL, Message.MessageReciverType.DEFAULT, _curVisitVo.NpcId));
            }
            else
            {
                PopupManager.ShowConfirmWindow(I18NManager.Get("Visit_Weather_Tips"), I18NManager.Get("Common_OK2")).WindowActionCallback = evt =>
                {
                    if (evt == WindowEvent.Ok)
                    {
                        SendMessage(new Message(MessageConst.MODULE_VISIT_SHOW_LEVEL_PANEL, Message.MessageReciverType.DEFAULT, _curVisitVo.NpcId));
                    }
                };
            }
            break;

        case MessageConst.CMD_VISIT_WEATHER_BLESSING_CLICK:
            Debug.Log("CMD_VISIT_WEATHER_BLESSING_CLICK");
            BlessResult result = (BlessResult)body[0];
            SendBlessingMsg(result);
            break;

        case MessageConst.CMD_VISIT_WEATHER_RESULT_CLICK:
            OnClickResultMask();
            break;
        }
    }
Example #21
0
 private void Level1_5End()
 {
     GoToNextGuideStage(I18NManager.Get("Guide_MainLinePhoneGuide"));
 }
    private void OnClickMoreInfoBtn()
    {
        var window = PopupManager.ShowWindow <FavorabilityNpcInfoWindwo>("FavorabilityMain/Prefabs/FavorabilityNpcInfoWindwo");

        window.SetData(I18NManager.Get("Favorability_NpcInfoTitle"), _moreInfo);
    }
Example #23
0
 private void Level2_9End()
 {
     GoToNextGuideStage(I18NManager.Get("Guide_MainLine2_9End"));
 }
Example #24
0
 private void FirstShowFans()
 {
     ResetFans();
     SetFans(I18NManager.Get("Battle_Prepare"));
 }
 public void RefreshAccumulate(int totalDate)
 {
     _descTxt.text = I18NManager.Get("Activity_Hint8", totalDate);
 }
    public void SetData(VisitBattleResultData data, PlayerModel playerModel)
    {
        transform.Find("StarAndGrade/Star").GetComponent <VisitStarComponent>().ShowStar(data.Star);
        // transform.Find("StarAndGrade/Text").GetComponent<Text>().text = "应援热度:<b> " + data.Cap + "</b>";
        transform.Find("StarAndGrade/Text/Text").GetComponent <Text>().text = data.Cap.ToString();
        var propContainer = transform.Find("Reward/Props");
        var cardContainer = transform.Find("Cards");

        for (int i = 0; i < data.RewardList.Count; i++)
        {
            GameObject item = InstantiatePrefab("VisitBattle/FinalEstimate/VisitBattleRewardItem");
            item.transform.SetParent(propContainer, false);

            DrawActivityDropItemVo extReward;
            data.DrawActivityDropItemDict.TryGetValue(i, out extReward);

            item.transform.gameObject.AddComponent <VisitBattleRewardItem>().SetData(data.RewardList[i], extReward);
            item.GetComponent <ItemShowEffect>().OnShowEffect(0.3f + i * 0.2f);
        }

        PlayerVo player = playerModel.PlayerVo;

        _levelText.text  = "Lv." + player.Level;
        _expAddText.text = "+" + data.Exp + " exp";

        var isOnVip = GlobalData.PlayerModel.PlayerVo.IsOnVip;

        _vip.gameObject.SetActive(isOnVip);

        _userNameText.text = I18NManager.Get("Battle_Name", player.UserName);

        int lastNeedExp = player.NeedExp;

        _expText.text = player.CurrentLevelExp + "/" + player.NeedExp;

        progressBar.DeltaX   = 0;
        progressBar.Progress = (int)((float)player.CurrentLevelExp / player.NeedExp * 100);

        bool isLevelup = playerModel.AddExp(data.Exp);

        int rate = (int)((float)player.CurrentLevelExp / player.NeedExp * 100);

        if (isLevelup)
        {
            if (player.Level >= 100)
            {
                _expText.text = "MAX";
            }
            else
            {
                DOTween.To(() => progressBar.Progress, x => progressBar.Progress = x, 100, 0.3f).SetDelay(0.9f)
                .onComplete =
                    () =>
                {
                    _expText.text        = player.CurrentLevelExp + "/" + player.NeedExp;
                    progressBar.DeltaX   = 0;
                    progressBar.Progress = 0;
                    DOTween.To(() => progressBar.Progress, x => progressBar.Progress = x, rate, 0.3f)
                    .SetDelay(1.3f);
                    Util.TweenTextNum(_expText, 0.3f, player.CurrentLevelExp, "", "/" + player.NeedExp);
                    _levelText.text = "Lv." + player.Level;
                };

                Util.TweenTextNum(_expText, 0.3f, lastNeedExp, "", "/" + lastNeedExp);
            }
        }
        else
        {
            if (player.Level >= 100)
            {
                _expText.text = "MAX";
            }
            else
            {
                DOTween.To(() => progressBar.Progress, x => progressBar.Progress = x, rate, 0.3f).SetDelay(0.9f);
                Util.TweenTextNum(_expText, 0.3f, player.CurrentLevelExp, "", "/" + player.NeedExp);
            }
        }

        for (int i = 0; i < data.UserCards.Count; i++)
        {
            GameObject item = InstantiatePrefab("Battle/FinalEstimate/RewardHeroCard");
            item.transform.SetParent(cardContainer, false);
            item.AddComponent <ItemShowEffect>().OnShowEffect(1 + i * 0.2f);

            var cardData = GlobalData.CardModel.GetUserCardById(data.UserCards[i].CardId);
            item.transform.GetComponent <RewardHeroCard>().SetData(cardData, data.CardExp);
        }

        StartCoroutine(StarRotation());
    }
Example #27
0
        public void SetData(RepeatedField <GameResultPB> result, VisitLevelVo customerSelectedLevel, int exp)
        {
            _isVip  = GlobalData.PlayerModel.PlayerVo.IsOnVip;
            _result = result;
            levelId = customerSelectedLevel.LevelId;

            transform.Find("Title/Text").GetComponent <Text>().text = customerSelectedLevel.LevelName;

            _total = 0;
            _drawActivityDropItemDict = new Dictionary <string, DrawActivityDropItemVo>();

            for (int i = 0; i < result.Count; i++)
            {
                GameResultPB pb = result[i];

                Dictionary <int, RewardVo> rewardDict = new Dictionary <int, RewardVo>();
                for (int j = 0; j < pb.Awards.Count; j++)
                {
                    RewardVo vo = new RewardVo(pb.Awards[j], true);
                    if (rewardDict.ContainsKey(vo.Id))
                    {
                        rewardDict[vo.Id].Num += vo.Num;
                    }
                    else
                    {
                        rewardDict.Add(vo.Id, vo);
                    }
                }

                RectTransform listItem = _content.GetChild(i).GetComponent <RectTransform>();
                var           isOnVip  = GlobalData.PlayerModel.PlayerVo.IsOnVip;
                if (isOnVip)
                {
                    listItem.Find("Title/Text2").GetComponent <Text>().text = "+" + exp + I18NManager.Get("Common_VIPExp");
                }
                else
                {
                    listItem.Find("Title/Text2").GetComponent <Text>().text = "+" + exp + I18NManager.Get("Common_Exp");
                }

                listItem.gameObject.Show();
                List <RewardVo> arr  = rewardDict.Values.ToList();
                var             prop = arr[arr.Count - 1];
                if (prop.Resource == ResourcePB.Item && prop.Id >= PropConst.CardUpgradePropSmall && prop.Id <= PropConst.CardUpgradePropLarge)
                {
                    arr.Insert(1, prop);
                    arr.RemoveAt(arr.Count - 1);
                }


                if (pb.DroppingItem != null && pb.DroppingItem.Count > 0)
                {
                    for (int k = 0; k < pb.DroppingItem.Count; k++)
                    {
                        DrawActivityDropItemVo vo = new DrawActivityDropItemVo(pb.DroppingItem[k], arr, HolidayModulePB.ActivityVisiting);
                        _drawActivityDropItemDict.Add(i + "_" + vo.DisplayIndex, vo);
                        _total = vo.TotalNum;
                    }
                }

                SetItemReward(listItem, arr, _drawActivityDropItemDict);

                float height = 440;
                if (arr.Count > 3)
                {
                    //2行的情况
                    height = 766;
                }
                float lineY = -height + 5;

                listItem.sizeDelta = new Vector2(listItem.sizeDelta.x, height);
                RectTransform linePos = listItem.Find("Line").GetComponent <RectTransform>();
                linePos.anchoredPosition = new Vector2(linePos.anchoredPosition.x, lineY);
            }

            //显示最终值
            foreach (var dropItemVo in _drawActivityDropItemDict)
            {
                dropItemVo.Value.TotalNum = _total;
            }
        }
Example #28
0
    public void SetData(FriendBaseInfo info, int state)
    {
        _recommenttran.gameObject.SetActive(state == 0);
        _applytran.gameObject.SetActive(state == 1);

        friendId    = info.UserId;
        _level.text = info.DepartmentLevel.ToString();
        _playersupportername.text = info.UserName;
        _playername.text          = info.UserName;
        //_headIcon.texture = null; //info.UserHead
        _collectedNum.text = I18NManager.Get("Friend_CardCollecter2", info.CardNum);//"星缘收集:"+info.CardNum;
        //Debug.LogError(info.LastLoginTime);
//        Debug.LogError(DateUtil.GetDataTime(info.LastLoginTime));
        _lastloginTime.text = DateUtil.GetTimeFormatMinute(ClientTimer.Instance.GetCurrentTimeStamp() - info.LastLoginTime) + I18NManager.Get("Friend_LoginBefore");
    }
Example #29
0
        public override void OnMessage(Message message)                       //主菜单消息发送
        {
            string name = message.Name;

            object[] body = message.Params;
            bool     isStopPlayDubbing = true;

            switch (name)
            {
            case MessageConst.CMD_MAIN_ON_STAR_ACTIVITY_BTN:
                if (GlobalData.MissionModel.IsShowStarActivity())
                {
                    ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_STAR_ACTIVITY, false, true, GlobalData.MissionModel.GetOpenDay());
                }
                else
                {
                    view.HandleFunctionOpen();
                }
                break;

            case MessageConst.CMD_MAIN_CHANGE_DISPLAY:                                    //--主菜单显示状态 Star
                MainMenuDisplayState state = (MainMenuDisplayState)message.Body;

                PopupManager.StopHandleShowWindow();

                switch (state)
                {
                case MainMenuDisplayState.ShowAll:
                    view.ShowAll();
                    //CheckNeedToDownLoadExtend();

                    PopupManager.ShowPhoneTipsWindow(() => SendRedPoint());
                    break;

                case MainMenuDisplayState.ShowUserInfo:
                    view.ShowUserInfo();
                    break;

                case MainMenuDisplayState.ShowUserInfoAndTopBar:
                    view.ShowTopBarAndUserInfo();
                    break;

                case MainMenuDisplayState.ShowTopBar:
                    view.ShowTopBar();
                    break;

                case MainMenuDisplayState.ShowVisitTopBar:
                    view.ShowTopBar(MainMenuDisplayState.ShowVisitTopBar);
                    break;

                case MainMenuDisplayState.HideAll:

                    if (_window != null)
                    {
                        _window.Close();
                    }

                    view.ShowAll(false);

                    break;

                case MainMenuDisplayState.ShowRecollectionTopBar:
                    view.ShowTopBar(MainMenuDisplayState.ShowRecollectionTopBar);
                    break;

                case MainMenuDisplayState.ShowExchangeIntegralBar:
                    view.ExchangeIntegralBarSetData(GlobalData.TrainingRoomModel.GetCurIntegral());
                    view.ShowTopBar(MainMenuDisplayState.ShowExchangeIntegralBar);
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }                                                                        //--主菜单显示状态 End
                break;

            case MessageConst.CMD_MAIN_ON_START_BTN:
                var isShowArrow = (bool)body[0];
                Debug.LogError("isShowArrow===>" + isShowArrow);
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_GAME_PLAY, false, true, isShowArrow);       //--模块消息发送 Start
                break;

            case MessageConst.CMD_MAIN_ON_CARD_BTN:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_CARD);
                break;

            case MessageConst.CMD_MAIN_ON_SUPPORTER_BTN:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_SUPPORTER);
                break;

            case MessageConst.CMD_TASK_SHOW_DAILYTASK:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_MISSION);
                break;

            case MessageConst.CMD_GOTOACHIEVEMENT:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACHIEVEMENT);
                break;

            case MessageConst.CMD_APPOINTMENT_JUMPCHOOSEROLE:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_LOVE);
                //PopupManager.ShowWindow<LoveJumpWindow>("GameMain/Prefabs/LoveJumpWindow/LoveJumpWindow");
                break;

            case MessageConst.CMD_MAIN_ON_CHANGE_ROLE_BTN:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_FAVORABILITYMAIN);
                break;

            case MessageConst.CMD_MAIN_ON_DRAWCARD_BTN:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_DRAWCARD);
                break;

            case MessageConst.CMD_MAIN_ON_PHONE_BTN:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_PHONE);
                break;

            case MessageConst.CMD_MAIN_ON_ACTIVITY_BTN:
                //SendActivityMsg();
                //进入活动模块
                var id = (string)message.Body;
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACTIVITY, false, true, id);
                break;

            case MessageConst.CMD_MAIN_ON_MAIL_BTN:

                PopupManager.StopHandleShowWindow();
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_MAIL);
                break;

            case MessageConst.CMD_MAIN_ON_ALBUM_BTN:
                FlowText.ShowMessage(I18NManager.Get("Common_Underdevelopment"));
                break;

            case MessageConst.CMD_MAIN_ON_STAGINGPOST_BTN:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_SHOP, false, true, 0);
                break;

            case MessageConst.CMD_MAIN_SHOW_BUY_POWER:                               //买体力
                var _buyPowerUpperlimit = GlobalData.PlayerModel.BuyPowerUpperlimit; //10
                if (GlobalData.PlayerModel.PlayerVo.PowerNum >= _buyPowerUpperlimit)
                {
                    FlowText.ShowMessage(I18NManager.Get("Common_TodaysBuyUpperlimit"));    // ("今日兑换次数已达上限");
                    return;
                }
                else
                {
                    ShowBuyPowerWindow();
                }
                break;

            case MessageConst.CMD_MAIN_SHOW_BUY_GOLD:                              //买金币
                var _buyGlodUpperlimit = GlobalData.PlayerModel.BuyGoldUpperlimit; //10
                if (GlobalData.PlayerModel.PlayerVo.GoldNum >= _buyGlodUpperlimit)
                {
                    FlowText.ShowMessage(I18NManager.Get("Common_TodaysBuyUpperlimit"));
                    return;
                }
                else
                {
                    ShowBuyGlodWindow();
                }
                break;

            case MessageConst.CMD_SUPPORTERACTIVITY_BUYENCOURAGEPOWER:                                 //买应援行动力

                var _buyEncouragePowerUpperlimit = GlobalData.PlayerModel.BuyEncouragePowerUpperlimit; //5
                if (GlobalData.PlayerModel.PlayerVo.EncourageNum >= _buyEncouragePowerUpperlimit)
                {
                    FlowText.ShowMessage(I18NManager.Get("Common_TodaysBuyUpperlimit"));
                    return;
                }
                else
                {
                    BuyEncouragePower();
                }
                break;

            case MessageConst.CMD_MAIN_SHOW_BUY_GEM:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_SHOP, false, true, 5);
                //ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_BUYGEN);
//                    ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_PAY,false);

//                    (SdkHelper.PayAgent as PayAgentGooglePlay)?.Test();
                break;

            case MessageConst.CMD_RECOLLECTION_SENDBUYEVENT:
                EventDispatcher.TriggerEvent(EventConst.SendBuyRecolletionPowerEvent);
                break;

            case MessageConst.CMD_MAIN_ON_LIVE2DCLICK:
                isStopPlayDubbing = false;
                SendNpcMainStageInteract();
                break;

            case MessageConst.CMD_MAIN_ON_FIRITSRECHARGE_BTN:
                //通过首冲进入活动模块
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACTIVITYFIRSTRECHARGE, false, true);
                break;

            case MessageConst.CMD_MAIN_STORESCORECOMMENT:
                bool   commentType = (bool)body[0];
                string comment     = (string)body[1];
                int    star        = (int)body[2];
                Debug.LogError(comment.Length);
                if (commentType)
                {
                    SetCommentRes(true, comment, star);
                }
                else
                {
                    if (comment.Length < 20)
                    {
                        FlowText.ShowMessage(I18NManager.Get("GameMain_MinTextCount"));
                        return;
                    }
                    else if (comment.Length > 600)
                    {
                        FlowText.ShowMessage(I18NManager.Get("GameMain_MaxTextCount"));
                        return;
                    }
                    SetCommentRes(false, comment, star);
                }


                break;

            case MessageConst.CMD_MAIN_FIRESHDOWNLOADAWARD:
//                    Debug.LogError("has receiveDownload"+GlobalData.PlayerModel.PlayerVo.ExtInfo.DownloadReceive);
                //GuideManager.SetStatisticsRemoteGuideStep(GuideConst.MainLineStep_Extend_DowndLoad);

                if (GlobalData.PlayerModel.PlayerVo.ExtInfo.DownloadReceive == 0)
                {
                    NetWorkManager.Instance.Send <ReceiveDownloadAwardsRes>(CMD.DOWNLOAD_RECEIVEAWARD, null, OnDownloadReceiveAward);
                }
//                    else
//                    {
//                        Debug.LogError("另外奖励又重新删包,在下载");
//                        SendMessage(new Message(MessageConst.CMD_DOWNLOAD_OK));
//                    }



                break;

            case MessageConst.CMD_MAIN_ON_PLAYERBIRTHDAY:
                if (GlobalData.MissionModel.IsShowPlayerBirthday())
                {
                    ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_PLAYERBIRTHDAY, false, true, GlobalData.MissionModel.GetPlayerBirthdayOpenDay());
                }
                else
                {
                    view.HandleFunctionOpen();
                }
                break;

            case MessageConst.CMD_MAIN_ON_ACTIVITYTEMPLATE_BTN:
                if (GlobalData.ActivityModel.IsShowActivityTemplateBtn(ActivityTypePB.ActivityDrawTemplate))
                {
                    ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACTIVITYTEMPLATE, false, true);
                }
                else
                {
                    view.HandleFunctionOpen();
                }
                break;

            case MessageConst.CMD_MAIN_ON_ACTIVITYCAPSULETEMPLATE_BTN:

                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACTIVITYCAPSULETEMPLATE, false, true);
                break;

            case MessageConst.CMD_MAIN_ON_TOTALRECHARGE_BTN:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACTIVITY, false, true, GlobalData.ActivityModel.GetActivityVo(ActivityType.ActivityAccumulativeRecharge).JumpId);
                break;

            case MessageConst.CMD_MAIN_ON_ACTIVITYMUSICTEMPLATE_BTN:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACTIVITYMUSICTEMPLATE, false, true);
                break;

            default:
                return;
            }

            if (isStopPlayDubbing)
            {
                StopPlayingDubbing();
            }
        }
Example #30
0
        private void OnGetBalance(TxBalanceRes res)
        {
            int num = (int)(res.Balance / 10);

            transform.GetText("BalanceText").text = I18NManager.Get("Shop_TencentBalance", num);
        }