Add docs, cleanup structure
This commit is contained in:
@@ -39,29 +39,15 @@ namespace Minigames.StatueDressup.Display
|
||||
return;
|
||||
}
|
||||
|
||||
// DecorationDataManager exists (initialized in OnManagedAwake) but data loads async
|
||||
// Wait for data to finish loading before displaying decorations
|
||||
StartCoroutine(WaitForDataAndDisplay());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wait for DecorationDataManager to finish loading data before displaying decorations
|
||||
/// </summary>
|
||||
private System.Collections.IEnumerator WaitForDataAndDisplay()
|
||||
{
|
||||
// Wait for data to load (manager is guaranteed to exist)
|
||||
while (!DecorationDataManager.Instance.IsLoaded)
|
||||
// Wait for decoration data manager to be ready (static method handles null instance)
|
||||
DecorationDataManager.WhenReady(() =>
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
|
||||
if (showDebugInfo)
|
||||
{
|
||||
Logging.Debug("[StatueDecorationLoader] DecorationData loaded, displaying decorations");
|
||||
}
|
||||
|
||||
// Load and display decorations
|
||||
LoadAndDisplayDecorations();
|
||||
if (showDebugInfo)
|
||||
{
|
||||
Logging.Debug("[StatueDecorationLoader] DecorationData ready, displaying decorations");
|
||||
}
|
||||
LoadAndDisplayDecorations();
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -70,7 +56,7 @@ namespace Minigames.StatueDressup.Display
|
||||
public void LoadAndDisplayDecorations()
|
||||
{
|
||||
// Check if DecorationData is loaded via manager
|
||||
if (DecorationDataManager.Instance == null || !DecorationDataManager.Instance.IsLoaded)
|
||||
if (DecorationDataManager.Instance == null || !DecorationDataManager.Instance.IsReady)
|
||||
{
|
||||
Logging.Warning("[StatueDecorationLoader] DecorationDataManager not ready. Cannot display decorations.");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user