Fix issues with puzzle loading order and add saving state when using Menu
This commit is contained in:
committed by
Michal Pikulski
parent
c527ba334d
commit
717deee0cd
@@ -102,7 +102,13 @@ namespace Levels
|
||||
isUnlocked = true;
|
||||
gameObject.SetActive(true);
|
||||
|
||||
// Save will happen automatically on next save cycle via ISaveParticipant
|
||||
// Add to global unlocked minigames list
|
||||
if (switchData != null && !string.IsNullOrEmpty(switchData.targetLevelSceneName))
|
||||
{
|
||||
Core.SaveLoad.SaveLoadManager.Instance?.UnlockMinigame(switchData.targetLevelSceneName);
|
||||
}
|
||||
|
||||
// Save will happen automatically on next save cycle via SaveableInteractable
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
@@ -231,6 +237,12 @@ namespace Levels
|
||||
|
||||
isUnlocked = data.isUnlocked;
|
||||
|
||||
// Sync with global unlocked minigames list
|
||||
if (isUnlocked && switchData != null && !string.IsNullOrEmpty(switchData.targetLevelSceneName))
|
||||
{
|
||||
Core.SaveLoad.SaveLoadManager.Instance?.UnlockMinigame(switchData.targetLevelSceneName);
|
||||
}
|
||||
|
||||
// Show/hide based on unlock state
|
||||
gameObject.SetActive(isUnlocked);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user