602c94726a
Start rebuild Save & Load game system
27 lines
665 B
C#
27 lines
665 B
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()
|
|
{
|
|
string sceneToGoTo = PlayerPrefs.GetString("SceneSaved");
|
|
SceneManager.LoadScene(sceneToGoTo);
|
|
int continued = 1;
|
|
PlayerPrefs.SetInt("continued", continued);
|
|
}
|
|
|
|
public void SaveItems()
|
|
{
|
|
SceneEquippableItemManager.Instance.SaveEquippableItems();
|
|
}
|
|
}
|