Cleanup compile warnings, cleanup logs, spruce up level selection menu
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Bootstrap
|
||||
@@ -56,7 +58,7 @@ namespace Bootstrap
|
||||
|
||||
IsBootComplete = true;
|
||||
|
||||
Debug.Log("[BootCompletionService] Boot process completed, executing initialization actions");
|
||||
LogDebugMessage("Boot process completed, executing initialization actions");
|
||||
|
||||
// Execute initialization actions in priority order (lower number = higher priority)
|
||||
ExecuteInitializationActions();
|
||||
@@ -67,7 +69,7 @@ namespace Bootstrap
|
||||
// Complete the task for async waiters
|
||||
_bootCompletionTask.TrySetResult(true);
|
||||
|
||||
Debug.Log("[BootCompletionService] All boot completion handlers executed");
|
||||
LogDebugMessage("All boot completion handlers executed");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -90,21 +92,21 @@ namespace Bootstrap
|
||||
if (IsBootComplete)
|
||||
{
|
||||
// If boot is already complete, execute immediately
|
||||
Debug.Log($"[BootCompletionService] Executing late registration: {name} (Priority: {priority})");
|
||||
LogDebugMessage($"Executing late registration: {name} (Priority: {priority})");
|
||||
try
|
||||
{
|
||||
action();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError($"[BootCompletionService] Error executing init action '{name}': {ex}");
|
||||
LogDebugMessage($"Error executing init action '{name}': {ex}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise add to the queue
|
||||
_initializationActions.Add(initAction);
|
||||
Debug.Log($"[BootCompletionService] Registered init action: {name} (Priority: {priority})");
|
||||
LogDebugMessage($"Registered init action: {name} (Priority: {priority})");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,17 +136,26 @@ namespace Bootstrap
|
||||
{
|
||||
try
|
||||
{
|
||||
Debug.Log($"[BootCompletionService] Executing: {action.Name} (Priority: {action.Priority})");
|
||||
LogDebugMessage($"Executing: {action.Name} (Priority: {action.Priority})");
|
||||
action.Action();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogError($"[BootCompletionService] Error executing init action '{action.Name}': {ex}");
|
||||
LogDebugMessage($"Error executing init action '{action.Name}': {ex}");
|
||||
}
|
||||
}
|
||||
|
||||
// Clear the list after execution
|
||||
_initializationActions.Clear();
|
||||
}
|
||||
|
||||
private static void LogDebugMessage(string message)
|
||||
{
|
||||
if (DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>().bootstrapLogVerbosity <=
|
||||
LogVerbosity.Debug)
|
||||
{
|
||||
Logging.Debug($"[BootCompletionService] {message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user