stash work
This commit is contained in:
@@ -36,25 +36,9 @@ namespace PuzzleS
|
||||
private bool _isLoadingLevelData = false;
|
||||
|
||||
/// <summary>
|
||||
/// Singleton instance of the PuzzleManager.
|
||||
/// Singleton instance of the PuzzleManager. No longer creates an instance if one doesn't exist.
|
||||
/// </summary>
|
||||
public static PuzzleManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null && Application.isPlaying && !_isQuitting)
|
||||
{
|
||||
_instance = FindAnyObjectByType<PuzzleManager>();
|
||||
if (_instance == null)
|
||||
{
|
||||
var go = new GameObject("PuzzleManager");
|
||||
_instance = go.AddComponent<PuzzleManager>();
|
||||
// DontDestroyOnLoad(go);
|
||||
}
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
public static PuzzleManager Instance => _instance;
|
||||
|
||||
// Events to notify about step lifecycle
|
||||
public event Action<PuzzleStepSO> OnStepCompleted;
|
||||
@@ -70,7 +54,6 @@ namespace PuzzleS
|
||||
void Awake()
|
||||
{
|
||||
_instance = this;
|
||||
// DontDestroyOnLoad(gameObject);
|
||||
|
||||
// Initialize settings reference
|
||||
_interactionSettings = GameManager.GetSettingsObject<IInteractionSettings>();
|
||||
@@ -78,16 +61,11 @@ namespace PuzzleS
|
||||
// Register for post-boot initialization
|
||||
BootCompletionService.RegisterInitAction(InitializePostBoot);
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
// Subscribe to scene manager events
|
||||
|
||||
}
|
||||
|
||||
void Start()
|
||||
private void InitializePostBoot()
|
||||
{
|
||||
// SceneManagerService subscription moved to InitializePostBoot
|
||||
// Subscribe to SceneManagerService events after boot is complete
|
||||
SceneManagerService.Instance.SceneLoadCompleted += OnSceneLoadCompleted;
|
||||
|
||||
// Find player transform
|
||||
_playerTransform = GameObject.FindGameObjectWithTag("Player")?.transform;
|
||||
@@ -100,12 +78,7 @@ namespace PuzzleS
|
||||
{
|
||||
LoadPuzzleDataForCurrentScene();
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializePostBoot()
|
||||
{
|
||||
// Subscribe to SceneManagerService events after boot is complete
|
||||
SceneManagerService.Instance.SceneLoadCompleted += OnSceneLoadCompleted;
|
||||
|
||||
Logging.Debug("[PuzzleManager] Subscribed to SceneManagerService events");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user