SaveLoad using managed lifecycle
This commit is contained in:
committed by
Michal Pikulski
parent
3e835ed3b8
commit
b932be2232
@@ -47,7 +47,7 @@ namespace Levels
|
||||
/// </summary>
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake(); // Register with save system
|
||||
base.Awake();
|
||||
|
||||
switchActive = true;
|
||||
if (iconRenderer == null)
|
||||
@@ -63,10 +63,10 @@ namespace Levels
|
||||
interactionSettings = GameManager.GetSettingsObject<IInteractionSettings>();
|
||||
ApplySwitchData();
|
||||
}
|
||||
|
||||
protected override void Start()
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
{
|
||||
base.Start(); // Register with save system
|
||||
base.OnManagedAwake();
|
||||
|
||||
// If startUnlocked is true, always start active
|
||||
if (startUnlocked)
|
||||
@@ -74,8 +74,7 @@ namespace Levels
|
||||
gameObject.SetActive(true);
|
||||
return;
|
||||
}
|
||||
|
||||
// Direct subscription - PuzzleManager available by this point
|
||||
|
||||
if (PuzzleManager.Instance != null)
|
||||
{
|
||||
PuzzleManager.Instance.OnAllPuzzlesComplete += HandleAllPuzzlesComplete;
|
||||
@@ -87,8 +86,10 @@ namespace Levels
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
|
||||
if (PuzzleManager.Instance != null)
|
||||
{
|
||||
PuzzleManager.Instance.OnAllPuzzlesComplete -= HandleAllPuzzlesComplete;
|
||||
|
||||
Reference in New Issue
Block a user