🚧 saving of field parameters as json implemented
This commit is contained in:
@@ -9,6 +9,7 @@ namespace Babushka.scripts.CSharp.Common.Farming;
|
||||
/// </summary>
|
||||
public partial class PlantBehaviour2D : Node2D
|
||||
{
|
||||
[Export] private string _prefabPath;
|
||||
[Export] private Sprite2D[] _seeds;
|
||||
[Export] private Sprite2D[] _smallPlants;
|
||||
[Export] private Sprite2D[] _bigPlants;
|
||||
@@ -24,6 +25,12 @@ public partial class PlantBehaviour2D : Node2D
|
||||
private bool _magicWordSaid = false;
|
||||
private bool _calledOnReady = false;
|
||||
|
||||
public PlantState State => _state;
|
||||
|
||||
public int DaysGrowing { get; set; }
|
||||
|
||||
public string PrefabPath => _prefabPath;
|
||||
|
||||
/// <summary>
|
||||
/// public accessor for the field reference
|
||||
/// </summary>
|
||||
@@ -35,7 +42,6 @@ public partial class PlantBehaviour2D : Node2D
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
GD.Print($"Ready: {Name}");
|
||||
if (_state == PlantState.None)
|
||||
{
|
||||
_state = PlantState.Planted;
|
||||
@@ -44,7 +50,6 @@ public partial class PlantBehaviour2D : Node2D
|
||||
}
|
||||
else
|
||||
{
|
||||
GD.Print("plant state not none.");
|
||||
_calledOnReady = true;
|
||||
GrowPlant();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user