Cleanup compile warnings, cleanup logs, spruce up level selection menu
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using AppleHills.Core.Settings;
|
||||
using UnityEngine;
|
||||
using UI;
|
||||
using Core;
|
||||
@@ -27,10 +28,11 @@ namespace Bootstrap
|
||||
private bool _bootComplete = false;
|
||||
private bool _hasStartedLoading = false;
|
||||
private float _sceneLoadingProgress = 0f;
|
||||
private LogVerbosity _logVerbosity = LogVerbosity.Warning;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Debug.Log("[BootSceneController] Boot scene started");
|
||||
LogDebugMessage("Boot scene started");
|
||||
|
||||
// Ensure the initial loading screen exists
|
||||
if (initialLoadingScreen == null)
|
||||
@@ -56,6 +58,8 @@ namespace Bootstrap
|
||||
50, // Higher priority (lower number)
|
||||
"BootSceneController.OnBootCompleted"
|
||||
);
|
||||
|
||||
_logVerbosity = DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>().bootstrapLogVerbosity;
|
||||
|
||||
// In debug mode, log additional information
|
||||
if (debugMode)
|
||||
@@ -69,12 +73,12 @@ namespace Bootstrap
|
||||
/// </summary>
|
||||
private void OnInitialLoadingComplete()
|
||||
{
|
||||
Debug.Log("[BootSceneController] Initial loading screen fully hidden, boot sequence completed");
|
||||
LogDebugMessage("Initial loading screen fully hidden, boot sequence completed");
|
||||
|
||||
// Play the intro cinematic if available
|
||||
if (CinematicsManager.Instance != null)
|
||||
{
|
||||
Debug.Log("[BootSceneController] Attempting to play intro cinematic");
|
||||
LogDebugMessage("Attempting to play intro cinematic");
|
||||
|
||||
// Use LoadAndPlayCinematic to play the intro sequence
|
||||
CinematicsManager.Instance.LoadAndPlayCinematic("IntroSequence");
|
||||
@@ -131,13 +135,13 @@ namespace Bootstrap
|
||||
{
|
||||
if (debugMode)
|
||||
{
|
||||
Debug.Log($"[BootSceneController] Bootstrap progress: {progress:P0}, Combined: {GetCombinedProgress():P0}");
|
||||
LogDebugMessage($"Bootstrap progress: {progress:P0}, Combined: {GetCombinedProgress():P0}");
|
||||
}
|
||||
}
|
||||
|
||||
private void LogDebugInfo()
|
||||
{
|
||||
Debug.Log($"[BootSceneController] Debug - Phase: {_currentPhase}, Bootstrap: {CustomBoot.CurrentProgress:P0}, " +
|
||||
LogDebugMessage($"Debug - Phase: {_currentPhase}, Bootstrap: {CustomBoot.CurrentProgress:P0}, " +
|
||||
$"Scene: {_sceneLoadingProgress:P0}, Combined: {GetCombinedProgress():P0}, Boot Complete: {_bootComplete}");
|
||||
}
|
||||
|
||||
@@ -146,7 +150,7 @@ namespace Bootstrap
|
||||
// Unsubscribe to prevent duplicate calls
|
||||
CustomBoot.OnBootCompleted -= OnBootCompleted;
|
||||
|
||||
Debug.Log("[BootSceneController] Boot process completed");
|
||||
LogDebugMessage("Boot process completed");
|
||||
_bootComplete = true;
|
||||
|
||||
// After a small delay, start loading the main menu
|
||||
@@ -166,7 +170,7 @@ namespace Bootstrap
|
||||
|
||||
private async void LoadMainScene()
|
||||
{
|
||||
Debug.Log($"[BootSceneController] Loading main menu scene: {mainSceneName}");
|
||||
LogDebugMessage($"Loading main menu scene: {mainSceneName}");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -180,7 +184,7 @@ namespace Bootstrap
|
||||
|
||||
if (debugMode)
|
||||
{
|
||||
Debug.Log($"[BootSceneController] Scene loading raw: {value:P0}, Combined: {GetCombinedProgress():P0}");
|
||||
LogDebugMessage($"Scene loading raw: {value:P0}, Combined: {GetCombinedProgress():P0}");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -229,7 +233,7 @@ namespace Bootstrap
|
||||
Scene currentScene = SceneManager.GetActiveScene();
|
||||
string startingSceneName = currentScene.name;
|
||||
|
||||
Debug.Log($"[BootSceneController] Unloading StartingScene: {startingSceneName}");
|
||||
LogDebugMessage($"Unloading StartingScene: {startingSceneName}");
|
||||
|
||||
// Unload the StartingScene
|
||||
await SceneManager.UnloadSceneAsync(startingSceneName);
|
||||
@@ -238,7 +242,7 @@ namespace Bootstrap
|
||||
Scene mainMenuScene = SceneManager.GetSceneByName(mainSceneName);
|
||||
SceneManager.SetActiveScene(mainMenuScene);
|
||||
|
||||
Debug.Log($"[BootSceneController] Transition complete: {startingSceneName} unloaded, {mainSceneName} is now active");
|
||||
LogDebugMessage($"Transition complete: {startingSceneName} unloaded, {mainSceneName} is now active");
|
||||
|
||||
// Destroy the boot scene controller since its job is done
|
||||
Destroy(gameObject);
|
||||
@@ -266,5 +270,13 @@ namespace Bootstrap
|
||||
_progressAction?.Invoke(value);
|
||||
}
|
||||
}
|
||||
|
||||
private void LogDebugMessage(string message)
|
||||
{
|
||||
if ( _logVerbosity <= LogVerbosity.Debug)
|
||||
{
|
||||
Logging.Debug($"[BootSceneController] {message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user