Ejemplo n.º 1
0
    public void SetInfo(UserFavorabilityVo vo, string bgImagePath)
    {
        _vo = vo;
        PresonBGTexture(vo.Apparel[0].ToString());
        BGTexture(bgImagePath);
        var isShow = GlobalData.PlayerModel.PlayerVo.IsGetShareAward(ShareTypePB.ShareClothes);



        SetShareTipsShow(!isShow);
    }
Ejemplo n.º 2
0
        public void GetUserFavorabilityData(RepeatedField <UserFavorabilityPB> pbs)
        {
            if (UserFavorabilityList == null)
            {
                UserFavorabilityList = new List <UserFavorabilityVo>();
            }

            foreach (var v in pbs)
            {
                //	Debug.LogError(v);
                var vo = new UserFavorabilityVo(v);

                UserFavorabilityList.Add(vo);
            }
        }
Ejemplo n.º 3
0
    public void SetData(UserFavorabilityVo vo)
    {
        if (jumpIndex != 0)
        {
            curIndex = jumpIndex;
        }
        else
        {
            curIndex = 0;
        }

        jumpIndex = 0;

        _userFavorabilityVo = vo;
        _rolename.text      = GlobalData.FavorabilityMainModel.GetPlayerName(vo.Player);
        _level.text         = vo.Level.ToString();

        _cardlist = GlobalData.CardModel.UserCardList.FindAll(x => { return(x.CardVo.Player == vo.Player); });

        _heartContainer.gameObject.SetActive(_cardlist.Count > 0);
        _heartBGContainer.gameObject.SetActive(_cardlist.Count > 0);


        //bug
        //没开放的卡牌或者那些没有配好感度数据的卡牌,出现异常的时候先直接给隐藏掉,换下一张!

        if (_cardlist.Count > 0)
        {
            //必须要一开始就设置好状态!
            SetIndexState(curIndex);
            SetCardData(_cardlist[curIndex]);
            _credit.gameObject.SetActive(true);
        }
        else
        {
            //空白的时候,什么都系都要默认为空白

            _credit.gameObject.SetActive(false);
            _title.text        = "";
            _roleImage.texture = null;
            SetStateTran(false, false, true);
            SetIndexState(-1);
        }
    }
Ejemplo n.º 4
0
    public void ShowHint(ReloadingVO vo, UserFavorabilityVo cur, ReloadingModel model, string bgImage = null)
    {
        _curRole = cur;
        _model   = model;
        var clothHintTxt = _clothHint.GetText("Text");

        if (vo.ItemType == DressUpTypePB.TypeClothes)
        {
            _lastOnClickCloth = vo;
            if (vo.IsGet == false)
            {
                _clothHint.gameObject.Show();
                clothHintTxt.text = I18NManager.Get("Reloading_Hint1", vo.UnlockDesc);
            }
            else
            {
                _clothHint.gameObject.Hide();
                clothHintTxt.text = "";
            }

            PresonBGTexture(vo.ItemId.ToString());
        }

        if (vo.ItemType == DressUpTypePB.TypeBackground)
        {
            _lastOnClickBackground = vo;
            if (vo.IsGet == false)
            {
                _clothHint.gameObject.Show();
                clothHintTxt.text = I18NManager.Get("Reloading_Hint2", vo.UnlockDesc);
            }
            else
            {
                _clothHint.gameObject.Hide();
                clothHintTxt.text = "";
            }

            BGTexture(bgImage);
        }
    }
Ejemplo n.º 5
0
    public override void SetData(params object[] paramsObjects)
    {
        if (paramsObjects.Length > 0)
        {
            if (paramsObjects[0] is string)
            {
                GlobalData.FavorabilityMainModel.CurrentRoleVo = GlobalData.FavorabilityMainModel.GetUserFavorabilityVo((int)paramsObjects[1]);
                switch ((string)paramsObjects[0])
                {
                case "SendGift":
                    CreatFavorabilityMain();
                    _favorabilityMainPanel.JumpTo((string)paramsObjects[0]);
                    break;

                case "Voice":
                    CreatFavorabilityMain();
                    _favorabilityMainPanel.IsCardJumpTo = true;
                    _favorabilityMainPanel.JumpTo((string)paramsObjects[0]);
                    break;
                }
            }
            else
            {
                RoleVo = (UserFavorabilityVo)paramsObjects[0];
                GlobalData.FavorabilityMainModel.CurrentRoleVo = RoleVo; //当前角色Id
                _favorabilityEnternPanel = new FavorabilityEnternPanel();
                _favorabilityEnternPanel.Init(this);
                _favorabilityEnternPanel.Show(0);
            }
        }
        else
        {
            if (_favorabilityEnternPanel == null)
            {
                _favorabilityEnternPanel = new FavorabilityEnternPanel();
                _favorabilityEnternPanel.Init(this);
                _favorabilityEnternPanel.Show(0);
            }
        }
    }
Ejemplo n.º 6
0
    public void SetData(UserFavorabilityVo vo)
    {
        _userFavorabilityVo = vo;
        _npcId      = (int)vo.Player;
        _level.text = vo.Level.ToString();
        var curNeedExp     = GlobalData.FavorabilityMainModel.GetCurrentLevelExpNeed(vo.Level);
        var curShowNeedExp = GlobalData.FavorabilityMainModel.GetCurrentLevelRule(vo.Level).Exp;

        if (vo.Level == _maxLevel)
        {
            _progressText.text     = GlobalData.FavorabilityMainModel.GetLastExp().ToString();
            _progressBar.DeltaX    = 0;
            _progressBar.ProgressY = 0;
        }
        else
        {
            _progressText.text     = vo.ShowExp + "/" + curShowNeedExp;
            _progressBar.DeltaX    = 0;
            _progressBar.ProgressY = (int)((float)vo.Exp / curNeedExp * 100);
        }
        _live2DGraphic.LoadAnimationById(vo.Apparel[0].ToString());
        BGTexture(GlobalData.FavorabilityMainModel.GetBgImageName(vo.Apparel[1]));
    }
Ejemplo n.º 7
0
    private void OnShowBattleIntroduction(int arg0)
    {
        Debug.Log("OnShowBattleIntroduction:" + arg0);
        VisitLevelVo vo = _curVisitChapterVo.GetVisitLevelVoById(arg0);

        //检测星缘解锁条件
        if (vo.LevelExtra.CardId != 0 && GlobalData.CardModel.GetUserCardById(vo.LevelExtra.CardId) == null)  //星缘
        {
            VisitLevelPreUnlockCardWindow window = PopupManager.ShowWindow <VisitLevelPreUnlockCardWindow>("Visit/Prefabs/VisitLevelPreUnlockCardWindow", Container);
            window.Init(vo);
            return;
        }
        //检测好感度等级
        if (vo.LevelExtra.Favorability != 0)
        {
            UserFavorabilityVo favorabilityVo = GlobalData.FavorabilityMainModel.GetUserFavorabilityVo((int)vo.NpcId);
            if (favorabilityVo != null && favorabilityVo.Level < vo.LevelExtra.Favorability)
            {
                ConfirmWindow win = PopupManager.ShowConfirmWindow(I18NManager.Get("Visit_Favorability_NoEnough_Tips", vo.LevelExtra.Favorability), null, I18NManager.Get("Common_Goto"));
                win.WindowActionCallback = evt =>
                {
                    if (evt == WindowEvent.Ok)
                    {
                        //var isOpen = GuideManager.IsOpen(ModulePB.Favorability, FunctionIDPB.FavorabilityView);
                        //if (!isOpen)
                        //{
                        //    var msg = GuideManager.GetOpenConditionDesc(ModulePB.Favorability, FunctionIDPB.FavorabilityView);
                        //    FlowText.ShowMessage(msg);
                        //    return;
                        //}

                        ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_FAVORABILITYMAIN, false, false, "SendGift", vo.NpcId);
                    }
                };
                return;
            }
        }

        if (vo.LevelType == LevelTypePB.Story)
        {
            int  npcId          = (int)_curVisitVo.NpcId;
            bool isShowLoaddown = CacheManager.IsVisitStoryItemLoaddown(npcId);
            if (!isShowLoaddown)
            {
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_STORY, false, false, vo);
            }
            else
            {
                CacheManager.ClickVisitStoryItem(npcId, () => {
                    ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_STORY, false, false, vo);
                }, () => {
                    ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_STORY, false, false, vo);
                });
            }
            return;
        }

        if (!GlobalData.CardModel.ContainsCardByNpcId(vo.NpcId))
        {
            string name = Util.GetPlayerName(vo.NpcId);
            PopupManager.ShowAlertWindow(I18NManager.Get("Visit_LevelNoConditionCard", name));
            return;
        }


        _battleIntroductionPopup = PopupManager.ShowWindow <VisitBattleIntroductionPopup>("Visit/Prefabs/VisitBattleIntroductionPopup");

        _battleIntroductionPopup.Init(vo, _curVisitVo);
        _battleIntroductionPopup.MaskColor = new Color(0, 0, 0, 0.5f);
        //     ClientData.CustomerSelectedLevel = level;
    }