private void RegisterListenerToLoadLevel(GameObject button, int zone, int level)
 {
     button.GetComponent <Button>().onClick.AddListener(() => {
         SaveDataRepo.Data.currentZone  = zone;
         SaveDataRepo.Data.currentLevel = level;
         LevelManager.Instance.zone     = zone;
         LevelManager.Instance.level    = level;
         SaveDataRepo.Commit();
         GameActionsManager.Instance.LoadApplicationLevel(3);
     });
 }
Example #2
0
    private void SyncSaveData()
    {
        SaveDataRepo.Data.currentZone  = zone;
        SaveDataRepo.Data.currentLevel = level;

        if (SaveDataRepo.Data.maxZone < zone)
        {
            SaveDataRepo.Data.maxZone  = zone;
            SaveDataRepo.Data.maxLevel = level;
        }

        if (SaveDataRepo.Data.maxLevel < level)
        {
            SaveDataRepo.Data.maxLevel = level;
        }

        SaveDataRepo.Commit();
    }