Finalize by subscribing to the new boot init order
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using AppleHills.Core.Settings;
|
||||
using Bootstrap;
|
||||
using Core;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using UnityEngine.ResourceManagement.AsyncOperations;
|
||||
@@ -73,6 +74,9 @@ namespace PuzzleS
|
||||
|
||||
// Initialize settings reference
|
||||
_interactionSettings = GameManager.GetSettingsObject<IInteractionSettings>();
|
||||
|
||||
// Register for post-boot initialization
|
||||
BootCompletionService.RegisterInitAction(InitializePostBoot);
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
@@ -83,7 +87,7 @@ namespace PuzzleS
|
||||
|
||||
void Start()
|
||||
{
|
||||
SceneManagerService.Instance.SceneLoadCompleted += OnSceneLoadCompleted;
|
||||
// SceneManagerService subscription moved to InitializePostBoot
|
||||
|
||||
// Find player transform
|
||||
_playerTransform = GameObject.FindGameObjectWithTag("Player")?.transform;
|
||||
@@ -97,7 +101,14 @@ 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");
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
StopProximityChecks();
|
||||
|
||||
Reference in New Issue
Block a user