stash work
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user