Update Cinematic Manager, Hud Manager, fix log verbosity issue, update PauseMenu
This commit is contained in:
@@ -951,7 +951,19 @@ MonoBehaviour:
|
||||
m_TargetGraphic: {fileID: 500835664005007083}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 3083882772934295339}
|
||||
m_TargetAssemblyTypeName: UI.PauseMenu, AppleHillsScripts
|
||||
m_MethodName: HideDevOptions
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!1 &4393876071688605581
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -56,7 +56,13 @@ namespace Bootstrap
|
||||
// Subscribe to boot progress for real-time updates during bootstrap
|
||||
CustomBoot.OnBootProgressChanged += OnBootProgressChanged;
|
||||
|
||||
_logVerbosity = DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>().bootstrapLogVerbosity;
|
||||
#if UNITY_EDITOR
|
||||
_logVerbosity = DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>().bootstrapLogVerbosity;
|
||||
#elif DEVELOPMENT_BUILD
|
||||
_logVerbosity = LogVerbosity.Debug;
|
||||
#elif RELEASE_BUILD
|
||||
_logVerbosity = LogVerbosity.Warning;
|
||||
#endif
|
||||
|
||||
// In debug mode, log additional information
|
||||
if (debugMode)
|
||||
|
||||
@@ -147,6 +147,8 @@ namespace Cinematics
|
||||
/// </summary>
|
||||
public PlayableDirector LoadAndPlayCinematic(string key, bool playPortraitMode)
|
||||
{
|
||||
InitializeComponents();
|
||||
|
||||
// Load the asset via addressables
|
||||
var handle = Addressables.LoadAssetAsync<PlayableAsset>(key);
|
||||
var result = handle.WaitForCompletion();
|
||||
|
||||
@@ -53,18 +53,34 @@ public class AudioManager : ManagedBehaviour, IPausable
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
{
|
||||
// Auto-registration with GameManager handled by ManagedBehaviour
|
||||
}
|
||||
// Initialize lists if they were not set in inspector
|
||||
criticalVOSources = criticalVOSources ?? new List<AppleAudioSource>();
|
||||
VOSources = VOSources ?? new List<AppleAudioSource>();
|
||||
musicSources = musicSources ?? new List<AppleAudioSource>();
|
||||
ambienceSources = ambienceSources ?? new List<AppleAudioSource>();
|
||||
SFXSources = SFXSources ?? new List<AppleAudioSource>();
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
_player = QuickAccess.Instance.PlayerGameObject;
|
||||
_audioListener = QuickAccess.Instance.MainCamera.GetComponent<AudioListener>();
|
||||
// Perform singleton-dependent initialization here
|
||||
if (QuickAccess.Instance != null)
|
||||
{
|
||||
_player = QuickAccess.Instance.PlayerGameObject;
|
||||
if (QuickAccess.Instance.MainCamera != null)
|
||||
{
|
||||
_audioListener = QuickAccess.Instance.MainCamera.GetComponent<AudioListener>();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[AudioManager] QuickAccess.Instance is null during OnManagedAwake. Some audio references may remain unset.");
|
||||
}
|
||||
|
||||
// Diagnostic
|
||||
foreach (AppleAudioSource _audioSource in criticalVOSources)
|
||||
{
|
||||
Debug.Log("Found source: " + _audioSource.name);
|
||||
}
|
||||
|
||||
Debug.Log("[AudioManager] OnManagedAwake completed");
|
||||
}
|
||||
|
||||
public void SetAudioPauseBehavior(PauseBehavior newPauseBehavior)
|
||||
|
||||
@@ -38,51 +38,33 @@ public class PlayerHudManager : ManagedBehaviour
|
||||
|
||||
_instance = this;
|
||||
|
||||
}
|
||||
|
||||
protected override void OnManagedAwake()
|
||||
{
|
||||
InitializePostBoot();
|
||||
InitializeReferences();
|
||||
}
|
||||
|
||||
private void InitializeReferences()
|
||||
{
|
||||
currentCinematicPlayer = landscapeObject;
|
||||
playableDirector = cinematicsParentObject.GetComponent<PlayableDirector>();
|
||||
cinematicSprites = currentCinematicPlayer.GetComponent<Image>();
|
||||
cinematicBackgroundSprites = CinematicBackground.GetComponent<Image>();
|
||||
playableDirector = cinematicsParentObject.GetComponent<PlayableDirector>();
|
||||
}
|
||||
|
||||
private void InitializePostBoot()
|
||||
|
||||
private void UpateCinematicReferences(GameObject newCinematicPlayer)
|
||||
{
|
||||
// Initialize any dependencies that require other services to be ready
|
||||
// For example, subscribe to SceneManagerService events if needed
|
||||
|
||||
|
||||
Logging.Debug("[PlayerHudManager] Post-boot initialization complete");
|
||||
currentCinematicPlayer = newCinematicPlayer;
|
||||
cinematicSprites = currentCinematicPlayer.GetComponent<Image>();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
// Subscribe to application quit event to ensure cleanup
|
||||
Application.quitting += OnApplicationQuit;
|
||||
}
|
||||
|
||||
private void OnApplicationQuit()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public void SetPortraitMode(bool portraitModeEnable)
|
||||
{
|
||||
if (portraitModeEnable)
|
||||
{
|
||||
currentCinematicPlayer = portraitObject;
|
||||
InitializeReferences();
|
||||
UpateCinematicReferences(portraitObject);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
currentCinematicPlayer = landscapeObject;
|
||||
InitializeReferences();
|
||||
UpateCinematicReferences(landscapeObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user