Disabled Saves, moved Folders adn renamed Data files, and added a state machine to the cookie puzzle

This commit is contained in:
2025-11-25 16:02:55 +01:00
parent 57be1a941c
commit c5736f836a
113 changed files with 1414 additions and 25 deletions

View File

@@ -0,0 +1,52 @@
using Core;
using UnityEngine;
using Core.Lifecycle;
[System.Serializable]
public class SoundBirdSaveData
{
public bool canFly;
}
public class soundBird_CanFly : ManagedBehaviour
{
public bool canFly = true;
// Enable save/load participation
public override bool AutoRegisterForSave => true;
public void birdCanHear(bool canhear)
{
canFly = canhear;
}
#region Save/Load Implementation
internal override string OnSceneSaveRequested()
{
var saveData = new SoundBirdSaveData
{
canFly = this.canFly
};
return JsonUtility.ToJson(saveData);
}
internal override void OnSceneRestoreRequested(string serializedData)
{
if (string.IsNullOrEmpty(serializedData))
{
Logging.Warning($"[soundBird_CanFly] No save data to restore for {gameObject.name}");
return;
}
var saveData = JsonUtility.FromJson<SoundBirdSaveData>(serializedData);
if (saveData != null)
{
canFly = saveData.canFly;
Logging.Debug($"[soundBird_CanFly] Restored canFly state: {canFly}");
}
}
#endregion
}