コード例 #1
0
    public void LoadMasterData()
    {
        // MapJsonを取得
        //TODO 定数
        var mapJson  = (Resources.Load("MasterData/" + Application.loadedLevelName + "/" + "Map") as TextAsset).text;
        var WrapJson = MapJsonHelper.GetWrapJson(mapJson);

        MapCellModel[] mapMasterModel = MapJsonHelper.FromJson <MapCellModel> (WrapJson);
        mMasterMapData = mapMasterModel.Select(m => new AdvCellModel(m)).ToList();
        for (int i = 0; i < mMasterMapData.Count; i++)
        {
            mMasterMapData [i].SetSideLineNumber(i);
        }
        //-----------------------
        // ItemJsonを取得
        //TODO 定数
        var itemJson     = (Resources.Load("MasterData/" + Application.loadedLevelName + "/" + "Item") as TextAsset).text;
        var ItemWrapJson = ItemJsonHelper.GetWrapJson(itemJson);

        ItemModel[] itemMasterModel = ItemJsonHelper.FromJson <ItemModel> (ItemWrapJson);
        mMasterItemData = itemMasterModel.ToList();
        //-----------------------
        // StoryJsonを取得
        //TODO 定数
        var storyJson     = (Resources.Load("MasterData/" + Application.loadedLevelName + "/" + "Story") as TextAsset).text;
        var StoryWrapJson = StoryJsonHelper.GetWrapJson(storyJson);

        StoryModel[] storyMasterModel = StoryJsonHelper.FromJson <StoryModel> (StoryWrapJson);
        mMasterStoryData = storyMasterModel.ToList();
    }
コード例 #2
0
    List <ItemModel> LoadMasterData()
    {
        var itemJson     = (Resources.Load("MasterData/Item") as TextAsset).text;
        var ItemWrapJson = ItemJsonHelper.GetWrapJson(itemJson);

        ItemModel[] itemMasterModel = ItemJsonHelper.FromJson <ItemModel> (ItemWrapJson);
        return(itemMasterModel.ToList());
    }