Example #1
0
 IEnumerator GoToNextLevel()
 {
     nextLvlTimer = 0;
     fadeScreen.gameObject.SetActive(true);
     while (nextLvlTimer < 225)
     {
         fadeScreen.color = Color.Lerp(fadeScreen.color, Color.black, Time.deltaTime * 4);
         nextLvlTimer    += 4;
         if (nextLvlTimer > 223)
         {
             _loadingScreen.LoadScreen();
         }
         yield return(new WaitForEndOfFrame());
     }
     fadeScreen.color = _oldDarkColor;
     fadeScreen.gameObject.SetActive(false);
     if (nextLvl != Application.levelCount)
     {
         if (setPlayableLevel > _playerStats.playableLevels)
         {
             _playerStats.playableLevels = setPlayableLevel;
         }
         _saveLoadData.Save(SavePaths.currentPath);
         Application.LoadLevel(nextLvl);
     }
     else
     {
         _saveLoadData.Save(SavePaths.currentPath);
         _loadingScreen.loadingScreen.SetActive(false);
         fadeScreen.gameObject.SetActive(false);
         StartCoroutine(_wwwScreenShot.UploadPNG());
     }
 }
Example #2
0
 public void UpdateQuestProgression(int quest, int value)
 {
     if (QuestData.quest == quest)
     {
         QuestData.questProgress = value;
         _save.Save();
     }
 }
Example #3
0
    public void EndType()
    {
        if (_npc == Names.SPIKE_DEATH)
        {
            LoadingScreen.isLoading = true;
            Application.LoadLevel(4);
        }
        if (_quest >= QuestData.questDone)
        {
            QuestData.quest = _quest;
            if (_questProgress == 100)
            {
                QuestData.questDone = _quest;
                ResetPlayerQuestData();
            }
        }

        if (_npc == Names.MALINCHE_START)
        {
            ResetPlayerQuestData();
            QuestData.quest = 3;
        }
        else if (_npc == Names.END)
        {
            LoadingScreen.isLoading = true;
            Application.LoadLevel(4);
        }

        _autoType.index = 0;
        talk.StopTalk();
        joystick.interact      = false;
        _playerController.move = true;
        //print ("Quests Done:" + QuestData._questDone);
        save.Save();
    }
Example #4
0
 void OnApplicationFocus(bool pauseStatus)
 {
     _paused = pauseStatus;
     if (!_paused)
     {
         _pauseScript.SetPaused();
         save.Save();
     }
 }
Example #5
0
 public void SaveHighscore()
 {
     _highscores[_currentLvl] = _score;
     _saveLoadData.Save();
 }
Example #6
0
 public void MainMenu()
 {
     _saveLoadData.Save(SavePaths.currentPath);
     ChangeTimeScale();
     Application.LoadLevel("Menu");
 }
Example #7
0
 public void Load()
 {
     LoadingScreen.isLoading = true;
     Application.LoadLevel(level);
     save.Save();
 }
Example #8
0
 public void BackToMainMenu()
 {
     LoadingScreen.isLoading = true;
     Application.LoadLevel(0);
     _saveLoadData.Save();
 }