|
|
|
|
@ -11,6 +11,7 @@ public partial class ItemOnGround2D : Node, ISaveable
|
|
|
|
|
[Export] public bool IsActive = true;
|
|
|
|
|
[Export] private bool _infiniteSupply = false;
|
|
|
|
|
[Export] private int _finiteSupply = 1;
|
|
|
|
|
[Export] private bool _saveToDisk = true;
|
|
|
|
|
|
|
|
|
|
private int pickUpCounter = 0;
|
|
|
|
|
|
|
|
|
|
@ -96,6 +97,9 @@ public partial class ItemOnGround2D : Node, ISaveable
|
|
|
|
|
// todo: What do we do with instances that are created at runtime?
|
|
|
|
|
public void UpdateSaveData()
|
|
|
|
|
{
|
|
|
|
|
if (!_saveToDisk)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
var payloadData = new Dictionary<string, Variant>
|
|
|
|
|
{
|
|
|
|
|
{"pickupCounter", pickUpCounter}
|
|
|
|
|
@ -107,6 +111,9 @@ public partial class ItemOnGround2D : Node, ISaveable
|
|
|
|
|
|
|
|
|
|
public void LoadFromSaveData()
|
|
|
|
|
{
|
|
|
|
|
if (!_saveToDisk)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (_infiniteSupply)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|