Пример #1
0
    public void Load()
    {
        string stringData = PlayerPrefs.GetString(KeySave.DAILY_REWARD_DATA);

        if (stringData.Equals(""))
        {
            int count = LoadResourceController.GetDailyRewardDataCollection().dataList.Count;
            for (int i = 0; i < count; i++)
            {
                int  day      = i + 1;
                bool opened   = i == 0 ? true : false;
                bool recieved = false;
                DailyRewardElementData data = new DailyRewardElementData(day, opened, recieved);
                dailyRewardData.AddData(data);
            }
            dailyRewardData.currentDay = 0;
            if (TimeManager.Ins != null)
            {
                TimeManager.Ins.SaveTime();
            }
            Save();
        }
        else
        {
            dailyRewardData = JsonUtility.FromJson <DataSaveDailyReward>(stringData);
            if (TimeManager.Ins != null)
            {
                TimeManager.Ins.UpdateCurrentTime(CheckTime);
            }
        }
    }
Пример #2
0
    public void LoadDailyReward()
    {
        DailyRewardDataCollection rewardData = LoadResourceController.GetDailyRewardDataCollection();
        var _data = CSVReader.Read(LoadResourceController.LoadFromResource <TextAsset>(CsvPath.CSV_PATH, CsvPath.FN_DAILY_REWARD));

        rewardData.ParseData(_data);
    }
Пример #3
0
 public void InitData()
 {
     dailyReward   = LoadResourceController.GetDailyRewardDataCollection();
     dataPlayer    = GameMgr.Ins.dataPlayer.playerDailyReward;
     dataMoney     = GameMgr.Ins.dataPlayer.playerMoney;
     currentDay    = dataPlayer.GetCurrentDay();
     dataCondition = dataPlayer.GetDailyRewardElementData();
     timeView      = Instantiate(timeView, timeViewParents);
 }