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

@@ -16,7 +16,7 @@ namespace PuzzleS
// Save system configuration
public override bool AutoRegisterForSave => true;
protected override void OnManagedAwake()
protected override void OnManagedStart()
{
// Initialize after all managers are ready
}

View File

@@ -1,4 +1,4 @@
using Input;
using Input;
using Interactions;
using UnityEngine;
using Core;
@@ -32,7 +32,7 @@ namespace PuzzleS
// Enum for tracking proximity state (simplified to just Close and Far)
public enum ProximityState { Close, Far }
protected override void Awake()
protected override void OnManagedAwake()
{
_interactable = GetComponent<InteractableBase>();
@@ -56,14 +56,10 @@ namespace PuzzleS
Logging.Warning($"[Puzzles] Indicator prefab for {stepData?.stepId} does not implement IPuzzlePrompt");
}
}
base.Awake();
}
protected override void OnManagedAwake()
protected override void OnManagedStart()
{
base.OnManagedAwake();
// Register with PuzzleManager - safe to access .Instance here
if (stepData != null && PuzzleManager.Instance != null)
{

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@@ -96,15 +96,13 @@ namespace PuzzleS
public override int ManagedAwakePriority => 80; // Puzzle systems
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;
}
protected override void OnManagedAwake()
protected override void OnManagedStart()
{
// Initialize settings reference
_interactionSettings = GameManager.GetSettingsObject<IInteractionSettings>();