Esempio n. 1
0
    //matching game ends in seconds
    private IEnumerator End(int inSec)
    {
        yield return(new WaitForSeconds(inSec));

        ProgressController.SaveProgress();
        AppController.instance.SetState(AppEnums.ApplicationStates.StoryMap);
    }
Esempio n. 2
0
    void SaveProgress()
    {
        PlayerProgress currLevelProgress = new PlayerProgress(
            levelMode,
            levelNo,
            starPercent,
            timePassed,
            wrongTries,
            nextNumber,
            true,
            false
            );

        ProgressController.SaveProgress(currLevelProgress);

        // If there is no level or we could not get one star, do not unlock next level.
        if (levelNo == levels.Count || starPercent < starPercents[0])
        {
            UICont.DisableNextButton();
            return;
        }

        // We have a next level, so unlock it.
        PlayerProgress nextLevelProgress = ProgressController.GetProgress(levelMode, levelNo + 1);

        nextLevelProgress.locked = false;

        ProgressController.SaveProgress(nextLevelProgress);
    }
Esempio n. 3
0
    private void ApplyProgress()
    {
        stay = true;

        AppController.instance.currentPlayer.SetGoDest();

        AppController.instance.currentPlayer.CalculateProgressPercentage();

        textMeshProProgressBar.text = "%" + AppController.instance.currentPlayer.ProgressPercentage /* + " Finished ("
                                                                                                     + AppController.instance.currentPlayer.LearnedItems.Count.ToString() + " of "
                                                                                                     + AppController.instance.dataController.allItemData.Length.ToString() + " words have learned)"*/;

        progressBarFiller.localScale = new Vector3(AppController.instance.currentPlayer.ProgressPercentage, 1, 1);

        ProgressController.SaveProgress();

        if (AppController.instance.currentPlayer.ProgressPercentage >= 100)
        {
            gameFinishedPanel.SetActive(true);
        }
        else
        {
            gameFinishedPanel.SetActive(false);
        }
    }
Esempio n. 4
0
 public void OnPlayAgainClicked()
 {
     ProgressController.SaveProgress();
     ProgressController.CreateNewPlayer();
     gameFinishedPanel.SetActive(false);
     AppController.instance.SetState(ApplicationStates.StartMenu);
     Debug.Log("Restart : Old Character saved as finished, new character created to play from begin.");
 }
Esempio n. 5
0
 private void OnApplicationQuit()
 {
     if (currentPlayer != null)
     {
         allPlayerProgressData.lastSessionPlayerId = currentPlayer.PlayerID;
         Debug.Log("Saved - Last Session Id : " + allPlayerProgressData.lastSessionPlayerId);
         ProgressController.SaveProgress();
     }
     else
     {
         Debug.Log("No currentPlayer Found and progress not saved.");
     }
 }