Beispiel #1
0
        public IEnumerator EndGameRoutine()
        {
            yield return(new WaitForSeconds(1f));

            GameOver.Get().Show();
            yield return(new WaitForSeconds(3f));

            PlayerData.Unload(); //Reload previous data
            SceneNav.RestartLevel();
        }
Beispiel #2
0
 void OnTriggerEnter2D(Collider2D coll)
 {
     if (coll.gameObject.GetComponent <PlayerCharacter>())
     {
         if (go_to_level != "")
         {
             SceneNav.GoToLevel(go_to_level, go_to_index);
         }
     }
 }
Beispiel #3
0
        public void OnClickContinue()
        {
            PlayerData pdata = PlayerData.Get();

            if (!string.IsNullOrEmpty(pdata.current_scene))
            {
                if (!string.IsNullOrEmpty(pdata.current_checkpoint))
                {
                    SceneNav.GoToCheckpoint(pdata.current_scene, pdata.current_checkpoint);
                }
                else
                {
                    SceneNav.GoToLevel(pdata.current_scene, pdata.current_entry_index);
                }
            }
        }
Beispiel #4
0
 void Start()
 {
     SceneNav.GoTo(SceneNav.load_scene);
 }
Beispiel #5
0
 public void OnClickNew()
 {
     PlayerData.NewGame();
     PlayerData.Save(); //Overwrite existing game
     SceneNav.GoToLevel(first_level);
 }
Beispiel #6
0
 public void Save()
 {
     PlayerData.Get().current_scene = SceneNav.GetCurrentScene();
     PlayerData.Save();
 }
Beispiel #7
0
 public void OnClickQuit()
 {
     SceneNav.ExitToStart();
 }