Rework of base interactables and managed behaviors

This commit is contained in:
Michal Pikulski
2025-11-04 11:11:27 +01:00
parent 0dc3f3e803
commit c57e3aa7e0
62 changed files with 11193 additions and 1376 deletions

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic;
using Bootstrap;
using Core;
using Core.Lifecycle;
using UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
@@ -14,7 +14,7 @@ namespace Cinematics
/// <summary>
/// Handles loading, playing and unloading cinematics
/// </summary>
public class CinematicsManager : MonoBehaviour
public class CinematicsManager : ManagedBehaviour
{
public event System.Action OnCinematicStarted;
public event System.Action OnCinematicStopped;
@@ -37,20 +37,21 @@ namespace Cinematics
public PlayableDirector playableDirector;
private void Awake()
public override int ManagedAwakePriority => 170; // Cinematic systems
private new void Awake()
{
_instance = this;
base.Awake(); // CRITICAL: Register with LifecycleManager!
// Register for post-boot initialization
BootCompletionService.RegisterInitAction(InitializePostBoot);
// Set instance immediately so it's available before OnManagedAwake() is called
_instance = this;
}
private void InitializePostBoot()
protected override void OnManagedAwake()
{
// Initialize any dependencies that require other services to be ready
// For example, subscribe to SceneManagerService events if needed
Logging.Debug("[CinematicsManager] Post-boot initialization complete");
Logging.Debug("[CinematicsManager] Initialized");
}
private void OnEnable()
{