示例#1
0
    private void Refresh()
    {
        var mapRecord = StageMapRecord.ReadStageMap(_StageInfo.StageRecord.ScenePath);

        for (int i = 0; i < _StarImgs.Count; ++i)
        {
            if (_StageInfo.IsStarOn(i))
            {
                _StarImgs[i].gameObject.SetActive(true);
            }
            else
            {
                _StarImgs[i].gameObject.SetActive(false);
            }

            _StarTexts[i].text = StarInfoBase.GetStarConditionStr(mapRecord._StarInfos[i]);
        }

        Dictionary <ELEMENT_TYPE, int> monsterList = new Dictionary <ELEMENT_TYPE, int>();

        foreach (var wave in mapRecord._MapStageLogic._Waves)
        {
            foreach (var monsterID in wave.NPCs)
            {
                var monRecord = Tables.TableReader.MonsterBase.GetRecord(monsterID);
                if (!monsterList.ContainsKey(monRecord.ElementType))
                {
                    monsterList.Add(monRecord.ElementType, 0);
                }
                ++monsterList[monRecord.ElementType];
            }
        }

        int monImgIdx = 0;

        foreach (var monsterType in monsterList)
        {
            if (monImgIdx == _EnemyImgs.Count)
            {
                break;
            }

            _EnemyImgs[monImgIdx].transform.parent.gameObject.SetActive(true);
            ResourceManager.Instance.SetImage(_EnemyImgs[monImgIdx], CommonDefine.GetElementIcon(monsterType.Key));
            _EnemyTexts[monImgIdx].text = monsterType.Value.ToString();

            ++monImgIdx;
        }

        for (int i = monImgIdx; i < _EnemyImgs.Count; ++i)
        {
            _EnemyImgs[i].transform.parent.gameObject.SetActive(false);
        }
    }
示例#2
0
    public void PassStage(StageMapRecord passStageMap)
    {
        List <AwardItem> awardList = new List <AwardItem>();

        _FightingStage = LogicManager.Instance.EnterStageInfo;
        var baseAward = AwardManager.AddAward(_FightingStage.StageRecord.AwardType[0], _FightingStage.StageRecord.AwardValue[0]);

        awardList.Add(baseAward);

        int starCnt = 0;

        for (int i = 0; i < 3; ++i)
        {
            if (_FightingStage.IsStarOn(i))
            {
                continue;
            }

            bool isGetStar = true;
            if (passStageMap._StarInfos.Count > i)
            {
                isGetStar = StarInfoBase.isCanGetStar(passStageMap._StarInfos[i]);
            }

            if (isGetStar)
            {
                StageDataPack.Instance.SetStageStar(_FightingStage.StageRecord.Id, i);

                var starAward = AwardManager.AddAward(_FightingStage.StageRecord.AwardType[i + 1], _FightingStage.StageRecord.AwardValue[i + 1]);
                awardList.Add(starAward);
            }
        }

        for (int i = 0; i < 3; ++i)
        {
            if (_FightingStage.IsStarOn(i))
            {
                ++starCnt;
            }
        }

        StageDataPack.Instance.SaveClass(true);
        UIFightBox.HideOptMask();
        UIStageSucess.ShowAsyn(_FightingStage.StageRecord, starCnt, awardList);

        WeaponDataPack.Instance.RefreshUnLock();
    }