2022-06-02 14:25:22 +02:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.SceneManagement;
|
|
|
|
|
|
|
|
public class SaveController : MonoBehaviour
|
|
|
|
{
|
|
|
|
public void SaveScene()
|
|
|
|
{
|
|
|
|
string activeScene = SceneManager.GetActiveScene().name;
|
|
|
|
PlayerPrefs.SetString("SceneSaved", activeScene);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void LoadScene()
|
|
|
|
{
|
2022-10-01 19:28:26 +02:00
|
|
|
OnMapAppearanceMethod.Gateway = OnMapAppearanceMethodEnum.LoadGame;
|
|
|
|
|
2022-06-02 14:25:22 +02:00
|
|
|
string sceneToGoTo = PlayerPrefs.GetString("SceneSaved");
|
|
|
|
SceneManager.LoadScene(sceneToGoTo);
|
2022-10-01 19:28:26 +02:00
|
|
|
}
|
2022-10-02 18:45:58 +02:00
|
|
|
|
|
|
|
public void SaveHealth()
|
|
|
|
{
|
|
|
|
var player = GameObject.FindGameObjectWithTag("Player");
|
|
|
|
player.GetComponent<Player>().SaveCheckpoint();
|
2022-06-02 14:25:22 +02:00
|
|
|
}
|
2022-06-17 22:22:19 +02:00
|
|
|
|
|
|
|
public void SaveItems()
|
|
|
|
{
|
|
|
|
SceneEquippableItemManager.Instance.SaveEquippableItems();
|
|
|
|
}
|
2022-06-19 02:56:04 +02:00
|
|
|
|
|
|
|
public void SaveQuests()
|
|
|
|
{
|
|
|
|
SceneTaskManager.Instance.SaveQuests();
|
|
|
|
}
|
2022-06-19 14:38:22 +02:00
|
|
|
|
|
|
|
public void SaveInventory()
|
|
|
|
{
|
|
|
|
SceneInventoryManager.Instance.SaveInventoryItems();
|
|
|
|
}
|
2022-06-02 14:25:22 +02:00
|
|
|
}
|