Fome further save load work

This commit is contained in:
Michal Pikulski
2025-11-03 10:08:44 +01:00
parent f0897c3e4a
commit cb7889b257
11 changed files with 1817 additions and 64 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using UnityEngine;
using Interactions;
using Bootstrap;
using Core.SaveLoad;
namespace Core
{
@@ -59,6 +60,7 @@ namespace Core
{
// Subscribe to scene load completed so we can clear registrations when scenes change
SceneManagerService.Instance.SceneLoadStarted += OnSceneLoadStarted;
Logging.Debug("[ItemManager] Subscribed to SceneManagerService events");
}

View File

@@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using AppleHills.Core.Settings;
using Bootstrap;
using UnityEngine;
@@ -55,12 +56,18 @@ namespace Core.SaveLoad
#if UNITY_EDITOR
OnSceneLoadCompleted("RestoreInEditor");
#endif
Load();
if (DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>().useSaveLoadSystem)
{
Load();
}
}
private void OnApplicationQuit()
{
Save();
if (DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>().useSaveLoadSystem)
{
Save();
}
}
private void InitializePostBoot()

View File

@@ -28,6 +28,10 @@ namespace AppleHills.Core.Settings
[Tooltip("Should Time.timeScale be set to 0 when the game is paused")]
[SerializeField] public bool pauseTimeOnPauseGame = true;
[Header("Save Load Options")]
[Tooltip("Should use save laod system?")]
[SerializeField] public bool useSaveLoadSystem = true;
[Header("Logging Options")]
[Tooltip("Logging level for bootstrap services")]
[SerializeField] public LogVerbosity bootstrapLogVerbosity = LogVerbosity.Warning;