Exemplo n.º 1
0
    public void Quit()
    {
        SoundManager.instance.PlaySound(SoundType.Tap);
        SystemSave.SaveGameManager();

        #if UNITY_EDITOR
        UnityEditor.EditorApplication.isPlaying = false;
         #else
        Application.Quit();
        #endif
    }
Exemplo n.º 2
0
    public void LoadPlayer()
    {
        PlayerData data = SystemSave.LoadPlayer();

        health = data.health;
        Vector3 position;

        position.x = data.position[0];
        position.y = data.position[1];
        position.z = data.position[2];

        transform.position = position;
    }
Exemplo n.º 3
0
    // Start is called before the first frame update
    public void LoadGame()
    {
        PlayerData player = SystemSave.LoadDataPlayer();

        if (player == null)
        {
            return;
        }
        Vector2 a = new Vector2(player.GetPotion(0), player.GetPotion(1));

        transform.position = new Vector3(a.x, a.y, transform.position.z);
        Jumps = player.GetJump();
        falls = player.GetFall();
    }
Exemplo n.º 4
0
 public void  LoadGameSave()
 {
     try
     {
         PlayerData data = SystemSave.LoadDataPlayer();
         if (data == null)
         {
             return;
         }
         SceneManager.LoadScene(2);
         return;
     }
     catch (Exception e)
     {
         return;
     }
 }
Exemplo n.º 5
0
    void Init()
    {
        //set all default value
        nbStar = new int[allLevel];
        for (int i = 0; i < nbStar.Length; i++)
        {
            nbStar[i] = 0;
        }

        //load and set save value
        GameManager loadGameManager = SystemSave.LoadGameManager();

        if (loadGameManager != null)
        {
            unlockLevel = loadGameManager.unlockLevel;
            for (int i = 0; i < loadGameManager.nbStar.Length; i++)
            {
                nbStar[i] = loadGameManager.nbStar[i];
            }
        }
    }
Exemplo n.º 6
0
 public void SavePlayer()
 {
     SystemSave.SavePlayer(this);
 }
Exemplo n.º 7
0
 public void SaveData()
 {
     SystemSave.SaveDataPlayer(this, Jumps, falls);
 }
Exemplo n.º 8
0
 public void DeleteSaveGame()
 {
     SystemSave.DeleteSavedGame();
 }