예제 #1
0
    public void SetData(PlayerPB npcId)
    {
        _npcId   = npcId;
        curNpcId = npcId;
        Debug.Log("VisitLevelController SetData NpcId is " + npcId);
        _curVisitVo         = GetData <VisitModel>().GetVisitVo(npcId);
        _visitChapterVoList = GetData <VisitModel>().GetVisitChapterVo(npcId);
        _curVisitChapterVo  = _visitChapterVoList[0];

        string mapId = _curVisitChapterVo.LevelList[0].ChapterBackdrop;
        //todo 坐标加载
        List <MapPos> mapPos = LoadJson(mapId);

        VisitLevelView.SetData(_curVisitVo, _visitChapterVoList[0], mapPos);


        //通关第一关时弹出天气指引
        if (_visitChapterVoList[0].LevelList.Count > 0)
        {
            VisitLevelVo vo = _visitChapterVoList[0].LevelList[0];

            if (vo.IsPass)
            {
                Common.GuideManager.OpenGuide(Common.GuideEnumType.VISIT_BLESS);
            }
        }
    }
예제 #2
0
 public void ChangeTabBar(PlayerPB pb, bool needtorefill = true)
 {
     //_currentTab = pb;
     _cardCollectionView.ChangeTabBar(pb, needtorefill);
     _cardPuzzleView.ChangeTabBar(pb);
     _cardResolveView.ChangeTabBar(pb);
 }
예제 #3
0
 private void ShowCoaxSleepPlayerAudioView(PlayerPB player)
 {
     _playerAudioPanel = new CoaxSleepPlayerAudioPanel();
     _playerAudioPanel.Init(this);
     _playerAudioPanel.Show(0f);
     _playerAudioPanel.SetCurPlayerPb(player);
 }
예제 #4
0
    public bool HasReceiveChievement(PlayerPB pb)
    {
        foreach (var v in UserMissionList)
        {
            if (_missionBaseDataDict.ContainsKey(v.MissionId))
            {
                var _missionitem = _missionBaseDataDict[v.MissionId];
                if (_missionitem.Player == pb && _missionitem.MissionType == MissionTypePB.StarCourse)
                {
                    if (v.MissionPro == 0)
                    {
                        return(true);
                    }
                }
            }
        }

        //判断是否有星路旅程阶段奖励
        if (StarCourseSchedule.ContainsKey(pb))
        {
            var usermissioninfo = StarCourseSchedule[pb];
            int weight          = 0;
            GetStarRoadRewardPBByCount(usermissioninfo.Progress, pb, ref weight, usermissioninfo.List);
//                Debug.LogError(usermissioninfo?.Progress+" "+weight);
            if (usermissioninfo?.Progress >= weight)
            {
                return(true);
            }
        }


        return(false);
    }
예제 #5
0
    public void SetMyCardData(List <UserCardVo> cards, PlayerPB filter = PlayerPB.None, bool needtorefillcells = true)
    {
        if (needtorefillcells)
        {
            _cardList.RefillCells();
        }

        _originalData = cards;

        if (filter != PlayerPB.None)
        {
            _data = cards.FindAll(match => { return(match.CardVo.Player == filter); });
        }
        else
        {
            _data = cards;
        }

        _tips.gameObject.SetActive(_curState == CardModule.CardViewState.MyCard && _data.Count == 0);
        //Debug.LogError(_data.Count);
        _cardList.totalCount = _data.Count;
        _cardList.RefreshCells();

        _carddetailRedpoint.SetActive(GlobalData.CardModel.ShowCardDetailRedPoint);
        _cardpuzzleRedpoint.SetActive(GlobalData.CardModel.ShowCardPuzzleRedpoint);
    }
예제 #6
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);
                }
            }
        };
    }
예제 #7
0
    public void InitMyData(MyVisitingRes res)
    {
        //关卡数据必须在前
        _myVisitLevelVos = new List <MyVisitLevelVo>();
        for (int i = 0; i < res.UserLevels.Count; i++)
        {
            MyVisitLevelVo vo = new MyVisitLevelVo(res.UserLevels[i]);
            _myVisitLevelVos.Add(vo);
            PlayerPB     NpcId   = (PlayerPB)((vo.LevelId / 1000) % 10);
            VisitLevelVo levelVo = GetVisitLevelVoById(vo.LevelId, NpcId);
            levelVo.MyVisitLevel = vo;
        }

        _listVo = new List <VisitVo>();
        for (int i = 0; i < res.UserWeathers.Count; i++)
        {
            VisitVo vo = new VisitVo(res.UserWeathers[i],
                                     GetWeatherRulesById(res.UserWeathers[i].WeatherId),
                                     GetVisitedTimesById(res.UserWeathers[i].Player),
                                     this
                                     );

            _listVo.Add(vo);
        }
    }
예제 #8
0
    public void SetData()
    {
        CacheVo vo = CacheManager.CheckPhoneCache();

        for (int i = 0; i < vo.sizeList.Count; i++)
        {
            //string NpcName = GlobalData.NpcModel.GetNpcById(i + 1).NpcName;
            PlayerPB playerPB = (PlayerPB)(i + 1);
            string   NpcName  = Util.GetPlayerName(playerPB);
            long     size     = vo.sizeList[i] / (1024 * 1024);
            int      isize    = int.Parse(size.ToString());
            toggles[i].transform.Find("Label").GetText().text = I18NManager.Get("Phone_DownloadContext", NpcName, isize);
        }
        for (int i = 0; i < 4; i++)
        {
            int NpcId = i + 1;
            if (vo.ids.Contains(NpcId))
            {
                SetToggle(NpcId, false);
            }
            else
            {
                SetToggle(NpcId, true);
            }
        }
    }
예제 #9
0
        public static string SpliceCardName(string name, PlayerPB pb)
        {
            string cardName = "";

            switch (pb)
            {
            case PlayerPB.None:
                cardName = "None";
                break;

            case PlayerPB.TangYiChen:
                cardName = I18NManager.Get("Common_Role1");
                break;

            case PlayerPB.QinYuZhe:
                cardName = I18NManager.Get("Common_Role2");    //"秦予哲";
                break;

            case PlayerPB.YanJi:
                cardName = I18NManager.Get("Common_Role3");     //"言季";
                break;

            case PlayerPB.ChiYu:
                cardName = I18NManager.Get("Common_Role4");    // "迟郁";
                break;
            }
            return(cardName + "·" + name);
        }
예제 #10
0
    public string GetPlayerName(PlayerPB playeridx)
    {
        string cardName = "";

        switch (playeridx)
        {
        case PlayerPB.TangYiChen:
            cardName = I18NManager.Get("Common_Role1");
            break;

        case PlayerPB.QinYuZhe:
            cardName = I18NManager.Get("Common_Role2");
            break;

        case PlayerPB.YanJi:
            cardName = I18NManager.Get("Common_Role3");
            break;

        case PlayerPB.ChiYu:
            cardName = I18NManager.Get("Common_Role4");
            break;

        default:
            cardName = I18NManager.Get("MainLine_BattleSweepWindowText");
            break;
        }

        return(cardName);
    }
예제 #11
0
        public void SetData(List <ResolveCardVo> data, PlayerPB filter = PlayerPB.None)
        {
            InitProps();
            _tabSelectedFilter = filter;
            _list.RefillCells();
            _selectAllToggle.isOn = false;


            _originalData = data;

            if (_tabSelectedFilter != PlayerPB.None)
            {
                _userCardList = data.FindAll(match => { return(match.Player == filter); });
            }
            else
            {
                _userCardList = data;
            }

            _list.totalCount = _userCardList.Count;
            _list.RefreshCells();

            if (_userCardList.Count == 0)
            {
                //FlowText.ShowMessage("待收集");
                _tips.gameObject.Show();
            }
            else
            {
                _tips.gameObject.Hide();
            }
        }
예제 #12
0
 public AwardPreviewVo(MissionActivityRewardRulePB pb)
 {
     Km     = pb.Weight;
     Desc   = I18NManager.Get("Achievement_AwardPreview", Km);
     Player = pb.Player;
     SetAwards(pb.Awards.ToList());
     SetIsGet();
 }
예제 #13
0
 public void ShowView(PlayerPB currentTab)
 {
     _currentTab = currentTab;
     if (_puzzleData == null)
     {
         SendMessage(new Message(MessageConst.CMD_CARD_COLLECTION_GET_USER_PUZZLUE));
     }
 }
예제 #14
0
        public void ChangeTabBar(PlayerPB pb)
        {
            if (_originalData == null)
            {
                return;
            }

            SetData(_originalData, pb);
        }
예제 #15
0
        private void ReceiveActReward(MissionTypePB missionTypePb, int weight, PlayerPB playerPb)
        {
            _curPlayerPb = playerPb;
            var buffer = NetWorkManager.GetByteData(new MissionActivityAwardsReq()
            {
                MissionType = missionTypePb, Weight = weight, Player = playerPb
            });

            NetWorkManager.Instance.Send <MissionActivityAwardsRes>(CMD.MISSION_ACTIVITYAWARDS, buffer, OnReceiveRewardCallBack);
        }
예제 #16
0
    public void SetData(PlayerPB npcId)
    {
        Debug.Log("WeatherController SetData NpcId is " + npcId);
        _curVisitVo = GetData <VisitModel>().GetVisitVo(npcId);

        WeatherView.SetData(_curVisitVo,
                            GetData <VisitModel>().WeatherRules,
                            GetData <VisitModel>().WeatherBlessRules
                            );
    }
예제 #17
0
 /// <summary>
 /// 通过卡生成
 /// </summary>
 public ShowCardModel(int cardId, SortResouce resource, SortCredit credit, DrawEventPB drawEvent, PlayerPB player, bool isNew, string cardName)
 {
     CardId    = cardId;
     Resource  = resource;
     DrawEvent = drawEvent;
     Credit    = credit;
     Player    = player;
     IsNew     = isNew;
     CardName  = cardName;
 }
예제 #18
0
 private UserCoaxSleepInfoPB GetUserInfoToPlayer(PlayerPB playerPb)
 {
     foreach (var userInfo in _userInfos)
     {
         if (userInfo.Player == playerPb)
         {
             return(userInfo);
         }
     }
     return(new UserCoaxSleepInfoPB());
 }
예제 #19
0
 private void DoGiftTrigger(PlayerPB player)
 {
     for (int i = 7007; i <= 7009; i++)
     {
         if (GlobalData.RandomEventModel.CheckTrigger(i))
         {
             new TriggerService().Request(i).ShowNewGiftWindow().Execute();
             break;
         }
     }
 }
예제 #20
0
//        private List<CardAwardPreInfo> _cardAwardPreInfos;
//
//        public CardAwardPreInfo GetCardAwardInfo(PlayerPB playerPb,CardVo vo)
//        {
//            if (_cardAwardPreInfos==null)
//            {
//                _cardAwardPreInfos = ExpressoinUtil.GetDialogCollects((int)playerPb);
//            }
//
//            foreach (var v in _cardAwardPreInfos)
//            {
//                if (v.dialogId==)
//                {
//
//
//                }
//
//            }
//
//
//
//        }

        public bool ContainsCardByNpcId(PlayerPB pb)
        {
            for (int i = 0; i < UserCardList.Count; i++)
            {
                if (UserCardList[i].CardVo.Player == pb)
                {
                    return(true);
                }
            }
            return(false);
        }
예제 #21
0
 public ResolveCardVo(UserCardVo vo)
 {
     Num = vo.Num - 1;
     CardId = vo.CardId;
     Credit = vo.CardVo.Credit;
     Name = vo.CardVo.CardName;
     Player = vo.CardVo.Player;
     CardPath = vo.CardVo.MiddleCardPath(vo.UserNeedShowEvoCard()&&vo.Level>60);//注意R卡!vo.UserNeedShowEvoCard()
     //ResolveItem = GlobalData.CardModel.GetCardEvoRule(Credit, Player)?.Resolve;
     ResolveItem = GlobalData.CardModel.GetCardResolveRule(Credit, Player).Resolve;
 }
예제 #22
0
    public void ChangeTabBar(PlayerPB pb)
    {
        if (_originalData == null)
        {
            return;
        }

        _currentTab = pb;
        _originalData.Sort();
        SetData(_originalData);
    }
예제 #23
0
    private void SendSaveReq(PlayerPB player)
    {
        DressUpReq req = new  DressUpReq
        {
            Player  = player,
            ItemIds = { _cloth.ItemId, _background.ItemId }
        };

        byte[] data = NetWorkManager.GetByteData(req);

        NetWorkManager.Instance.Send <DressUpRes>(CMD.FAVORABILITY_DRESSUP, data, DressUpSucceed);
    }
예제 #24
0
 public void UpdateVisitLevelVo(UserVisitingLevelPB pb)
 {
     UserId     = pb.UserId;
     LevelId    = pb.LevelId;
     Star       = pb.Star;
     Count      = pb.Count;
     ResetTime  = pb.ResetTime;
     Score      = pb.MaxFraction;
     BuyCount   = pb.BuyCount;
     IsGetFirst = pb.FirstAwardsState == 1;
     NpcId      = (PlayerPB)((LevelId / 1000) % 10);
 }
예제 #25
0
    /// <summary>
    /// 获取对应Npc的音频数据
    /// </summary>
    /// <param name="playerPb"></param>
    /// <returns></returns>
    public List <MyCoaxSleepAudioData> GetMyUserDataToPlayer(PlayerPB playerPb)
    {
        List <MyCoaxSleepAudioData> list = new  List <MyCoaxSleepAudioData>();

        foreach (var uData in _myUserData)
        {
            if (uData.PlayerPb == playerPb)
            {
                list.Add(uData);
            }
        }
        return(list);
    }
예제 #26
0
    private void OnVisitSelectItemWeatherClick(PlayerPB NpcId)
    {
        VISIT_WEATHER weather = _visitModel.GetWeatherByNpcId(NpcId);

        //if (weather == VISIT_WEATHER.Fine)
        //{
        //    FlowText.ShowMessage(I18NManager.Get("Visit_CurBestWeather"));
        //}
        //else
        //{
        SendMessage(new Message(MessageConst.MODULE_VISIT_SHOW_WEATHER_PANEL, Message.MessageReciverType.DEFAULT, NpcId));
        // }
    }
예제 #27
0
        //进化时需要用到的数据
        public CardEvoRulePB GetCardEvoRule(CreditPB credit, PlayerPB playerPb, EvolutionPB evolutionPb)
        {
            for (int i = 0; i < _cardEvolutionRuleList.Count; i++)
            {
                CardEvoRulePB pb = _cardEvolutionRuleList[i];
                if (pb.Credit == credit && pb.Player == playerPb && pb.Evo == evolutionPb)
                {
                    return(pb);
                }
            }

            return(null);
        }
예제 #28
0
//        public CardEvoRulePB GetCardEvoRule(CreditPB credit, PlayerPB playerPb)
//        {
//            for (int i = 0; i < _cardEvolutionRuleList.Count; i++)
//            {
//                CardEvoRulePB pb = _cardEvolutionRuleList[i];
//                if (pb.Credit == credit && pb.Player == playerPb)
//                    return pb;
//            }
//
//            return null;
//        }

        public CardResolveRulePB GetCardResolveRule(CreditPB creditPb, PlayerPB playerPb)
        {
            for (int i = 0; i < _cardResolveRuleList.Count; i++)
            {
                CardResolveRulePB pb = _cardResolveRuleList[i];
                if (pb.Credit == creditPb && pb.Player == playerPb)
                {
                    return(pb);
                }
            }

            return(null);
        }
예제 #29
0
        public static void ClickItem(int NpcId, Action finish = null, Action cancel = null)
        {
            int needtoTips = 1;
            int cunId      = 1008699 + NpcId;

            if (PlayerPrefs.HasKey("RecordLoveStory" + cunId))
            {
                needtoTips = PlayerPrefs.GetInt("RecordLoveStory" + cunId);
            }
            Debug.LogError("cunId " + cunId);
            CacheVo vo = CacheManager.CheckPhoneCache();

            if (vo.needDownload == false || !vo.ids.Contains(NpcId) || needtoTips != 1)
            {
                finish?.Invoke();
                return;
            }

            PlayerPB playerPB = (PlayerPB)(NpcId);
            string   NpcName  = Util.GetPlayerName(playerPB);

            long size = 10;

            if (NpcId < vo.sizeList.Count)
            {
                size = vo.sizeList[NpcId - 1] / (1024 * 1024);
            }

            int isize = int.Parse(size.ToString());

            if (Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork)
            {
                CacheManager.DownloadPhoneCache(NpcId, (str) =>
                {
                    finish?.Invoke();
                });
            }
            else
            {
                //弹出确认框
                string content = I18NManager.Get("Phone_IsDownloadContext", NpcName, isize);
                CacheManager.ConfirmPhoneNeedToDownload(content
                                                        , I18NManager.Get("Download_JumpDownload"), cunId, NpcId, str =>
                {
                    finish?.Invoke();
                }, () =>
                {
                    cancel?.Invoke();
                });
            }
        }
예제 #30
0
    public VisitLevelVo GetVisitLevelVoById(int levelId, PlayerPB NpcId)
    {
        List <VisitChapterVo> list = VisitChapterDir[NpcId];

        for (int i = 0; i < list.Count; i++)
        {
            VisitLevelVo vo = list[i].LevelList.Find((m) => { return(levelId == m.LevelId); });
            if (vo != null)
            {
                return(vo);
            }
        }
        return(null);
    }