|
|
|
|
@ -12,6 +12,7 @@ namespace Babushka.scripts.CSharp.Common.Temp;
|
|
|
|
|
public partial class MVPDuck : Node2D, ISaveable
|
|
|
|
|
{
|
|
|
|
|
[ExportGroup("Persistence")]
|
|
|
|
|
// A container for the current scene. Used to automatically add the current scene context to the save ID.
|
|
|
|
|
[Export] public VariableResource _sceneKeyProvider;
|
|
|
|
|
|
|
|
|
|
[ExportGroup("Animation")]
|
|
|
|
|
@ -56,6 +57,9 @@ public partial class MVPDuck : Node2D, ISaveable
|
|
|
|
|
|
|
|
|
|
#region SAVE AND LOAD
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
// Saves duck position.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void UpdateSaveData()
|
|
|
|
|
{
|
|
|
|
|
var payloadData = new Dictionary<string, Variant>
|
|
|
|
|
@ -69,6 +73,9 @@ public partial class MVPDuck : Node2D, ISaveable
|
|
|
|
|
SavegameService.AppendDataToSave(_sceneKeyProvider.Payload.AsString(), id, payloadData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Loads duck position.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void LoadFromSaveData()
|
|
|
|
|
{
|
|
|
|
|
var sceneName = _sceneKeyProvider.Payload.AsString();
|
|
|
|
|
|