Final touchups to the lifecycle management

This commit is contained in:
Michal Pikulski
2025-11-11 10:53:09 +01:00
parent 0aa2270e1a
commit 9a6914b9bd
38 changed files with 62 additions and 229 deletions

View File

@@ -15,9 +15,6 @@ namespace UI.Core
[Header("Page Settings")]
public string PageName;
// UI pages load after UI infrastructure (UIPageController is priority 50)
public override int ManagedAwakePriority => 200;
// Events using System.Action instead of UnityEvents
public event Action OnTransitionInStarted;
public event Action OnTransitionInCompleted;

View File

@@ -37,8 +37,6 @@ namespace UI.Core
private PlayerInput _playerInput;
private InputAction _cancelAction;
public override int ManagedAwakePriority => 50; // UI infrastructure
internal override void OnManagedAwake()
{
// Set instance immediately (early initialization)
@@ -50,10 +48,8 @@ namespace UI.Core
Logging.Debug("[UIPageController] Initialized");
}
protected override void OnDestroy()
internal override void OnManagedDestroy()
{
base.OnDestroy();
// Clean up cached instances
foreach (var cachedPage in _prefabInstanceCache.Values)
{