Add distinction between managed awake and managed start

This commit is contained in:
Michal Pikulski
2025-11-10 15:52:53 +01:00
parent c4d356886f
commit 7565b189b9
48 changed files with 990 additions and 1639 deletions

View File

@@ -31,11 +31,9 @@ namespace UI
// After UIPageController (50)
public override int ManagedAwakePriority => 55;
private new void Awake()
protected override void OnManagedAwake()
{
base.Awake(); // CRITICAL: Register with LifecycleManager!
// Set instance immediately so it's available before OnManagedAwake() is called
// Set instance immediately (early initialization)
_instance = this;
// Ensure we have a CanvasGroup for transitions
@@ -51,9 +49,9 @@ namespace UI
gameObject.SetActive(false);
}
protected override void OnManagedAwake()
protected override void OnManagedStart()
{
// Subscribe to scene-dependent events - must be in OnManagedAwake, not OnSceneReady
// Subscribe to scene-dependent events - must be in OnManagedStart, not OnSceneReady
// because PauseMenu is in DontDestroyOnLoad and OnSceneReady only fires once
if (SceneManagerService.Instance != null)
{