43 lines
1.0 KiB
C#
43 lines
1.0 KiB
C#
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()
|
|
{
|
|
OnMapAppearanceMethod.Gateway = OnMapAppearanceMethodEnum.LoadGame;
|
|
|
|
string sceneToGoTo = PlayerPrefs.GetString("SceneSaved");
|
|
SceneManager.LoadScene(sceneToGoTo);
|
|
}
|
|
|
|
public void SaveHealth()
|
|
{
|
|
var player = GameObject.FindGameObjectWithTag("Player");
|
|
player.GetComponent<Player>().SaveCheckpoint();
|
|
}
|
|
|
|
public void SaveItems()
|
|
{
|
|
SceneEquippableItemManager.Instance.SaveEquippableItems();
|
|
}
|
|
|
|
public void SaveQuests()
|
|
{
|
|
SceneTaskManager.Instance.SaveQuests();
|
|
}
|
|
|
|
public void SaveInventory()
|
|
{
|
|
SceneInventoryManager.Instance.SaveInventoryItems();
|
|
}
|
|
}
|