Пример #1
0
    private void LoadWeekData()
    {
        string loadDateString;

        weekDataObj = new SaveDataObject();
        weekDataObj.Init();
        weekDataObj.InitSum();
        for (int i = 0; i < 7; i++)
        {
            loadDateString = CreateFilename(-i);
            LoadData(loadDateString, weekDataObj);
        }
    }
Пример #2
0
    private void LoadMonthData()
    {
        string loadDateString;

        monthDataObj = new SaveDataObject();
        monthDataObj.Init();
        monthDataObj.InitSum();
        for (int i = 0; i < 30; i++)
        {
            loadDateString = CreateFilename(-i);
            LoadData(loadDateString, monthDataObj);
        }
    }
Пример #3
0
 // Start is called before the first frame update
 void Start()
 {
     gameState        = "StartGame";
     currentGridClick = -1;
     // Load Previous Data
     todayDateString = CreateFilename(0);
     Debug.Log(todayDateString);
     saveDataObj = new SaveDataObject();
     saveDataObj.Init();
     saveDataObj.InitSum();
     LoadData(todayDateString, saveDataObj);
     //
     for (int i = 0; i < 26; i++)
     {
         Debug.Log("LP" + saveDataObj.medlevelPlayed[i]);
     }
     //
     LoadWeekData();
     LoadMonthData();
     //
     playVOAudio("title_new");
     //
     toggleMusicOn();
 }
Пример #4
0
 void ParseDisplayData(int _letterSelect, SaveDataObject _dataObj)
 {
     if (_letterSelect == -1)
     {
         _dataObj.InitSum();
         _dataObj.TotalSum();
         //
         LevelsText[0].text = _dataObj.lowlevelSum.ToString();
         LevelsText[1].text = _dataObj.medlevelSum.ToString();
         LevelsText[2].text = _dataObj.highlevelSum.ToString();
         //
         float lowPercent   = 0;
         float medPercent   = 0;
         float highPercent  = 0;
         float totalPercent = 0;
         if (_dataObj.lowlevelSum != 0)
         {
             lowPercent = 100f - (100f * (_dataObj.lowmissSum / (_dataObj.lowlevelSum * 3f + _dataObj.lowmissSum)));
             Debug.Log(lowPercent);
         }
         if (saveDataObj.medlevelSum != 0)
         {
             medPercent = 100f - (100f * (_dataObj.medmissSum / (_dataObj.medlevelSum * 3f + _dataObj.medmissSum)));
         }
         if (saveDataObj.highlevelSum != 0)
         {
             highPercent = 100f - (100f * (_dataObj.highmissSum / (_dataObj.highlevelSum * 3f + _dataObj.highmissSum)));
         }
         //
         PercentText[0].text = lowPercent.ToString("F1");
         PercentText[1].text = medPercent.ToString("F1");
         PercentText[2].text = highPercent.ToString("F1");
         //
         float lowMinutes  = _dataObj.lowtimeSum / 60f;
         float medMinutes  = _dataObj.medtimeSum / 60f;
         float highMinutes = _dataObj.hightimeSum / 60f;
         //
         TimeSpentText[0].text = lowMinutes.ToString("F1");
         TimeSpentText[1].text = medMinutes.ToString("F1");
         TimeSpentText[2].text = highMinutes.ToString("F1");
         //
         if (_dataObj.levelSum != 0)
         {
             totalPercent = 100f - (100f * (_dataObj.missSum / (_dataObj.levelSum * 3f + _dataObj.missSum)));
         }
         float totalMinutes = _dataObj.timeSum / 60f;
         LevelsText[3].text    = _dataObj.levelSum.ToString();
         PercentText[3].text   = totalPercent.ToString("F1");
         TimeSpentText[3].text = totalMinutes.ToString("F1");
     }
     else
     {
         _dataObj.InitSum();
         _dataObj.LevelSum(_letterSelect);
         //
         LevelsText[0].text = _dataObj.lowlevelPlayed[_letterSelect].ToString();
         LevelsText[1].text = _dataObj.medlevelPlayed[_letterSelect].ToString();
         LevelsText[2].text = _dataObj.highlevelPlayed[_letterSelect].ToString();
         //
         float lowPercent   = 0;
         float medPercent   = 0;
         float highPercent  = 0;
         float totalPercent = 0;
         if (_dataObj.lowlevelPlayed[_letterSelect] != 0)
         {
             lowPercent = 100f - (100f * (_dataObj.lowlevelMiss[_letterSelect] / (_dataObj.lowlevelPlayed[_letterSelect] * 3f + _dataObj.lowlevelMiss[_letterSelect])));
         }
         if (saveDataObj.medlevelPlayed[_letterSelect] != 0)
         {
             medPercent = 100f - (100f * (_dataObj.medlevelMiss[_letterSelect] / (_dataObj.medlevelPlayed[_letterSelect] * 3f + _dataObj.medlevelMiss[_letterSelect])));
         }
         if (saveDataObj.highlevelPlayed[_letterSelect] != 0)
         {
             highPercent = 100f - (100f * (_dataObj.highlevelMiss[_letterSelect] / (_dataObj.highlevelPlayed[_letterSelect] * 3f + _dataObj.highlevelMiss[_letterSelect])));
         }
         //
         PercentText[0].text = lowPercent.ToString("F1");
         PercentText[1].text = medPercent.ToString("F1");
         PercentText[2].text = highPercent.ToString("F1");
         //
         float lowMinutes  = _dataObj.lowlevelTime[_letterSelect] / 60f;
         float medMinutes  = _dataObj.medlevelTime[_letterSelect] / 60f;
         float highMinutes = _dataObj.highlevelTime[_letterSelect] / 60f;
         //
         TimeSpentText[0].text = lowMinutes.ToString("F1");
         TimeSpentText[1].text = medMinutes.ToString("F1");
         TimeSpentText[2].text = highMinutes.ToString("F1");
         //
         if (_dataObj.levelSum != 0)
         {
             totalPercent = 100f - (100f * (_dataObj.missSum / (_dataObj.levelSum * 3f + _dataObj.missSum)));
         }
         float totalMinutes = _dataObj.timeSum / 60f;
         LevelsText[3].text    = _dataObj.levelSum.ToString();
         PercentText[3].text   = totalPercent.ToString("F1");
         TimeSpentText[3].text = totalMinutes.ToString("F1");
     }
 }