update to unity 6.2, add save system and quest system
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class GameManager : MonoBehaviour
|
||||
{
|
||||
public static GameManager Instance { get; private set; }
|
||||
public DialogueManager DialogueManager { get; private set; }
|
||||
public Storybools Storybools { get; private set; }
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -19,6 +21,34 @@ private void Awake()
|
||||
DontDestroyOnLoad(gameObject);
|
||||
|
||||
DialogueManager = GetComponent<DialogueManager>();
|
||||
SaveSystem.Load();
|
||||
}
|
||||
}
|
||||
|
||||
#region Storybool Save/Load
|
||||
public void SaveStoryBools(ref StoryboolSaveData data)
|
||||
{
|
||||
data.Storybools = Instance.Storybools;
|
||||
}
|
||||
|
||||
public void LoadStoryBools(StoryboolSaveData data)
|
||||
{
|
||||
if (data.Storybools != null)
|
||||
{
|
||||
Instance.Storybools = data.Storybools;
|
||||
}
|
||||
else
|
||||
{
|
||||
Instance.Storybools = new Storybools();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public int StarShards = 0; // will replace with inventory system
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public struct StoryboolSaveData
|
||||
{
|
||||
public Storybools Storybools;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user