Example #1
0
    public void SaveStage()
    {
        //수정한 스테이지 데이터 저장, 스테이지UI와 해당 스테이지 총 크기 비율로 계산한 위치,인덱스 등 저장
        List <StageDataTable> tempList = new List <StageDataTable>();

        for (int i = 0; i < monsterExamList.Count; ++i)
        {
            if (monsterExamList[i] == null)
            {
                continue;
            }
            StageDataTable temp = new StageDataTable();
            temp.worldLevel = int.Parse(worldDropDown.captionText.text);
            temp.stageLevel = int.Parse(stageDropDwon.captionText.text);
            temp.enemyIndex = int.Parse(monsterExamList[i].indexText.text);
            temp.enemyLevel = int.Parse(monsterExamList[i].levelText.text);
            temp.boss       = monsterExamList[i].boss;
            Vector2 pos = monsterExamList[i].GetCoord();
            temp.enemyPosX = pos.x;
            temp.enemyPosY = pos.y;
            tempList.Add(temp);
        }
        stageDataTable[int.Parse(worldDropDown.captionText.text)][int.Parse(stageDropDwon.captionText.text)] = tempList;
        ShowGetInfo(int.Parse(stageDropDwon.captionText.text));
    }
Example #2
0
        private void Construct(GameType gameType)
        {
            switch (gameType)
            {
            case GameType.ScoreAttack:
                _bindStageDataTable = scoreAttackStageDataTable;
                break;

            case GameType.FreePlay:
                _bindStageDataTable = freePlayStageDataTable;
                break;

            case GameType.None:
            default:
                throw new ArgumentOutOfRangeException(nameof(gameType), gameType, null);
            }
        }
Example #3
0
    private IEnumerator StartLoad(string fileName, Dictionary <int, Dictionary <int, List <StageDataTable> > > table)
    {
        string path = string.Format("{0}/LitJson/{1}.json", Application.streamingAssetsPath, fileName);
        WWW    www  = new WWW(path);

        yield return(www);

        string   jsonString = www.text;
        JsonData jsonData   = JsonMapper.ToObject(jsonString);

        for (int i = 0; i < jsonData.Count; ++i)
        {
            StageDataTable save = JsonMapper.ToObject <StageDataTable>(jsonData[i].ToJson());
            if (table.ContainsKey(save.GetTableID()))
            {
                if (table[save.GetTableID()].ContainsKey(save.GetStageID()))
                {
                    table[save.GetTableID()][save.GetStageID()].Add(save);
                }
                else
                {
                    List <StageDataTable> temp = new List <StageDataTable>();
                    temp.Add(save);
                    table[save.GetTableID()].Add(save.GetStageID(), temp);
                }
            }
            else
            {
                Dictionary <int, List <StageDataTable> > tempDic = new Dictionary <int, List <StageDataTable> >();
                List <StageDataTable> temp = new List <StageDataTable>();
                temp.Add(save);
                tempDic.Add(save.GetStageID(), temp);
                table.Add(save.GetTableID(), tempDic);
            }
        }

        Setting();
    }
Example #4
0
 public StageRepository(StageDataTable stageDataTable, StageObjectTable stageObjectTable)
 {
     _stageDataTable   = stageDataTable;
     _stageObjectTable = stageObjectTable;
 }
Example #5
0
 public StageDataRepository(StageDataTable stageDataTable)
 {
     _stageDataTable = stageDataTable;
 }
Example #6
0
        public StageDataRepository(int level, StageDataTable stageDataTable)
        {
            var stageData = stageDataTable.stageDataList[level];

            _stageDataEntity = JsonUtility.FromJson <StageDataEntity>(stageData.ToString());
        }