コード例 #1
0
ファイル: HeroEquipWidget.cs プロジェクト: fqkw6/AStartTest
    public void SetInfo(HeroInfo heroInfo, ItemInfo itemInfo)
    {
        _heroInfo = heroInfo;
        _itemInfo = itemInfo;

        _starPanel.SetStar(heroInfo.StarLevel);
        _imgIconBg.sprite = ResourceManager.Instance.GetHeroBgByStar(heroInfo.StarLevel);
        _imgIcon.sprite   = ResourceManager.Instance.GetHeroImage(heroInfo.ConfigID);
        _txtHeroName.text = heroInfo.GetName();

        _txtHeroName.color  = ResourceManager.Instance.GetColorByQuality(heroInfo.StarLevel);
        _txtFightScore.text = heroInfo.FightingScore.ToString();

        _imgItemType.sprite = ResourceManager.Instance.GetItemTypeIcon((ItemType)itemInfo.Cfg.Type);

        ItemInfo curItemInfo = heroInfo.GetItemByType((ItemType)itemInfo.Cfg.Type);

        if (curItemInfo != null)
        {
            _itemWidget.SetInfo(curItemInfo);
            _itemWidget.gameObject.SetActive(true);
        }
        else
        {
            _itemWidget.gameObject.SetActive(false);
        }
    }
コード例 #2
0
    public override void OnRefreshWindow()
    {
        MissionConstConfig cfg = MissionConstConfigLoader.GetConfig(_levelID);
        if (cfg == null) return;

        _txtLossSp.text = cfg.StaminaCost.ToString();
        _txtPVEInfo.text = cfg.MissionDescription;

        _imageCommonPVE.gameObject.SetActive(cfg.MissionDegree == (int)ChapterType.NORMAL);
        _imageSeniorPVE.gameObject.SetActive(cfg.MissionDegree == (int)ChapterType.ELITE);

        List<AwardInfo> awardList = AwardManager.Instance.GetAwardList(cfg.CompleteAward, true);
        for (int i = 0; i < 4; ++i) {
            SimpleItemWidget widget = _itemWidget[i];
            if (i < awardList.Count) {
                widget.SetInfo(awardList[i].ItemID, 1);
            } else {
                widget.gameObject.SetActive(false);
            }
        }

        LevelInfo info = PVEManager.Instance.GetLevelInfo(_levelID);
        if (info == null || info.star < 3) {
            _btnQuickFight.gameObject.SetActive(false);
            _btnQuickFight10.gameObject.SetActive(false);
            _txtDekaronNumber.text = string.Format("{0}/{1}", cfg.TimesLimit, cfg.TimesLimit);
        } else {
            _txtDekaronNumber.text = string.Format("{0}/{1}", cfg.TimesLimit - info.fightCount, cfg.TimesLimit);
        }

        if (cfg.TimesLimit <= 0) {
            _txtDekaronGameObject.gameObject.SetActive(false);
        } else {
            _txtDekaronGameObject.gameObject.SetActive(true);
        }

        // 上阵英雄
        for (int i = 0; i < _myHeroWidget.Length; ++i) {
            var widget = _myHeroWidget[i];
            if (i < UserManager.Instance.PVEHeroList.Count) {
                HeroInfo heroInfo = UserManager.Instance.PVEHeroList[i];
                widget.gameObject.SetActive(true);
                widget.SetInfo(heroInfo.ConfigID, heroInfo.StarLevel, heroInfo.Level, heroInfo.StarLevel);
            } else {
                widget.gameObject.SetActive(false);
            }
        }

        for (int i = 0; i < _enemyHeroWidget.Length; ++i) {
            var widget = _enemyHeroWidget[i];

        }
        foreach (var item in UserManager.Instance.HeroList) {
            
        }

        UpdateCondition(info);

        _txtQuickFight10.text = Str.Format("UI_PVE_QUICK_FIGHT_COUNT", PVEManager.Instance.GetQuickFightCount(_levelID));
    }
コード例 #3
0
ファイル: UIPVPRuleView.cs プロジェクト: fqkw6/AStartTest
    public override void OnRefreshWindow()
    {
        // 历史最高排名
        if (PVPManager.Instance.MyHighRank <= 0)
        {
            _txtHighRank.text = Str.Get("UI_PVP_NOT_IN_RANK");
        }
        else
        {
            _txtHighRank.text = PVPManager.Instance.MyHighRank.ToString();
        }

        _txtRule.text = Str.Get("UI_PVP_RULE");

        int myRank = PVPManager.Instance.MyRank;

        _txtAward.text = Str.Format("UI_PVP_DAILY_AWARD", myRank);

        ArenaDailyRankConfig cfg = null;

        foreach (var item in ArenaDailyRankConfigLoader.Data)
        {
            if (myRank <= item.Value.LowerRank && myRank >= item.Value.UpperRank)
            {
                cfg = item.Value;
                break;
            }
        }

        if (cfg != null)
        {
            List <AwardInfo> list = AwardManager.Instance.GetAwardList(cfg.AwardId);
            for (int i = 0; i < _itemWidget.Length; ++i)
            {
                SimpleItemWidget item = _itemWidget[i];
                if (i < list.Count)
                {
                    _txtAward.gameObject.SetActive(true);
                    item.SetInfo(list[i].ItemID, list[i].ItemCount);
                }
                else
                {
                    item.gameObject.SetActive(false);
                }
            }
        }
        else
        {
            _txtAward.gameObject.SetActive(false);
            foreach (var item in _itemWidget)
            {
                item.gameObject.SetActive(false);
            }
        }
    }
コード例 #4
0
    public void SetInfo(BattleResultInfo result, int index)
    {
        for (int i = 0; i < _itemWidget.Length; ++i)
        {
            SimpleItemWidget itemWidget = _itemWidget[i];
            if (i < result.itemInfo.Count)
            {
                ItemInfo itemInfo = result.itemInfo[i];
                itemWidget.SetInfo(itemInfo.ConfigID, itemInfo.Number);
            }
            else
            {
                itemWidget.gameObject.SetActive(false);
            }
        }

        _txtPlayerExp.text = "x" + result.addPlayerExp.ToString();
        _txtMoney.text     = result.addMoney.ToString();
        _txtTitle.text     = string.Format(Str.Get("UI_PVE_QUICK_FIGHT_RESULT_TITLE"), index + 1);
    }
コード例 #5
0
    public override void SetInfo(object info)
    {
        _info = (MailInfo)info;

        if (_info.ItemList.Count > 0)
        {
            _itemWidget.SetInfo(_info.ItemList[0]);
            _itemWidget.gameObject.SetActive(true);
        }
        else
        {
            _itemWidget.gameObject.SetActive(false);
        }

        _txtTitle.text = Str.Format("UI_MAIL_TITLE", _info.Title);
        _txtFrom.text  = Str.Format("UI_MAIL_FROM", _info.FromPlayerName);
        _txtTime.text  = Str.Format("UI_MAIL_TIME", _info.SendTime.GetTime());
        _imgRead.gameObject.SetActive(_info.HasGet);
        _imgNotRead.gameObject.SetActive(!_info.HasGet);
    }
コード例 #6
0
    public override void OnOpenWindow()
    {
        if (PVEManager.Instance.QuickFightResult.Count <= 0)
        {
            return;
        }

        BattleResultInfo result = PVEManager.Instance.QuickFightResult[0];

        _txtMoney.text     = result.addMoney.ToString();
        _txtPlayerExp.text = "x" + result.addPlayerExp.ToString();

        for (int i = 0; i < _itemWidget.Length; ++i)
        {
            SimpleItemWidget itemWidget = _itemWidget[i];
            if (i >= result.itemInfo.Count)
            {
                itemWidget.gameObject.SetActive(false);
            }
            else
            {
                ItemInfo itemInfo = result.itemInfo[i];
                itemWidget.SetInfo(itemInfo.ConfigID, itemInfo.Number);
            }
        }

        for (int i = 0; i < _itemWidgetExtra.Length; ++i)
        {
            SimpleItemWidget itemWidget = _itemWidgetExtra[i];
            itemWidget.gameObject.SetActive(false);
//            if (i >= result.itemInfo.Count) {
//                itemWidget.gameObject.SetActive(false);
//            } else {
//                ItemInfo itemInfo = result.itemInfo[i];
//                itemWidget.SetInfo(itemInfo.ConfigID, itemInfo.Number);
//            }
        }
    }