stash work

This commit is contained in:
Michal Pikulski
2025-10-16 16:18:04 +02:00
parent c7906a9968
commit d2c6c5df38
19 changed files with 353 additions and 277 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using Bootstrap;
using Core;
using UnityEngine;
using UnityEngine.AddressableAssets;
@@ -27,31 +28,26 @@ namespace Cinematics
private Dictionary<PlayableDirector, AsyncOperationHandle<PlayableAsset>> _addressableHandles
= new Dictionary<PlayableDirector, AsyncOperationHandle<PlayableAsset>>();
public static CinematicsManager Instance
{
get
{
if (_instance == null && Application.isPlaying && !_isQuitting)
{
_instance = FindAnyObjectByType<CinematicsManager>();
if (_instance == null)
{
var go = new GameObject("CinematicsManager");
_instance = go.AddComponent<CinematicsManager>();
// DontDestroyOnLoad(go);
}
}
return _instance;
}
}
/// <summary>
/// Singleton instance of the CinematicsManager. No longer creates an instance if one doesn't exist.
/// </summary>
public static CinematicsManager Instance => _instance;
public PlayableDirector playableDirector;
private void Awake()
{
_instance = this;
// Initialize required components
InitializeComponents();
// Register for post-boot initialization
BootCompletionService.RegisterInitAction(InitializePostBoot);
}
private void InitializePostBoot()
{
// 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");
}
private void OnEnable()

View File

@@ -31,23 +31,6 @@ namespace Cinematics
radialProgressBar.fillAmount = 0f;
}
}
void OnEnable()
{
// Only handle the case where the GameObject is enabled after boot is already complete
if (!_initialized && BootCompletionService.IsBootComplete)
{
// Boot is already complete but we haven't initialized yet, do it now
Logging.Debug("[SkipCinematic] OnEnable: Boot already complete, initializing now");
InitializePostBoot();
}
else if (_initialized)
{
// If we're already initialized, just ensure subscriptions are active
SubscribeToCinematicsEvents();
}
// If boot isn't complete, our InitializePostBoot method will be called via the BootCompletionService
}
void OnDisable()
{