46 lines
1.0 KiB
C#
46 lines
1.0 KiB
C#
using UnityEngine;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using Unity.VisualScripting;
|
|
|
|
|
|
|
|
|
|
public class StateManager : MonoBehaviour
|
|
{
|
|
public static StateManager Instance { get; private set; }
|
|
|
|
public int currentSceneIndex = 0;
|
|
|
|
|
|
[SerializeField] public List<SaveableBerryBush> BerryBushData = new List<SaveableBerryBush>();
|
|
[SerializeField] public List<SaveableTwig> TwigData = new List<SaveableTwig>();
|
|
|
|
[SerializeField] public List<SaveableNPC> NPCData = new List<SaveableNPC>();
|
|
|
|
[SerializeField] public SaveablePlayer PlayerData;
|
|
private void Awake()
|
|
{
|
|
if (Instance != null && Instance != this)
|
|
{
|
|
Destroy(gameObject); // Only one instance allowed
|
|
return;
|
|
}
|
|
|
|
Instance = this;
|
|
DontDestroyOnLoad(gameObject); // Persist through scenes
|
|
|
|
}
|
|
|
|
public void SaveGameState()
|
|
{
|
|
Debug.Log("Saving game state...");
|
|
}
|
|
|
|
public void LoadGameState()
|
|
{
|
|
Debug.Log("Restoring game state");
|
|
}
|
|
|
|
}
|