|
|
|
|
@ -33,7 +33,6 @@ public partial class FieldBehaviour2D : Sprite2D, ISaveable
|
|
|
|
|
|
|
|
|
|
[ExportGroup("Field Interactions")]
|
|
|
|
|
[Export] public InteractionArea2D PlantingInteraction;
|
|
|
|
|
[Export] public InteractionArea2D FieldInteractionArea;
|
|
|
|
|
|
|
|
|
|
[ExportGroup("Configuration")]
|
|
|
|
|
[Export] public Node2D PlantingPlaceholder;
|
|
|
|
|
@ -61,7 +60,7 @@ public partial class FieldBehaviour2D : Sprite2D, ISaveable
|
|
|
|
|
// fieldstate == tilled && watering can ausgewählt
|
|
|
|
|
_canWater = (FieldState == FieldState.Tilled || FieldState == FieldState.Planted) && _wateringCanActive;
|
|
|
|
|
|
|
|
|
|
FieldInteractionArea.IsActive = _canPlant || _canWater;
|
|
|
|
|
PlantingInteraction.IsActive = _canPlant || _canWater;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void ActivatedSeedInInventory(bool activated)
|
|
|
|
|
@ -100,21 +99,25 @@ public partial class FieldBehaviour2D : Sprite2D, ISaveable
|
|
|
|
|
case FieldState.Empty:
|
|
|
|
|
FieldState = FieldState.Empty;
|
|
|
|
|
PlantingInteraction.IsActive = false;
|
|
|
|
|
PlantingInteraction.ProcessMode = ProcessModeEnum.Disabled;
|
|
|
|
|
break;
|
|
|
|
|
case FieldState.Tilled:
|
|
|
|
|
FieldState = FieldState.Tilled;
|
|
|
|
|
_fieldSprite.Texture = Tilled;
|
|
|
|
|
PlantingInteraction.IsActive = true;
|
|
|
|
|
PlantingInteraction.ProcessMode = ProcessModeEnum.Inherit;
|
|
|
|
|
break;
|
|
|
|
|
case FieldState.Watered:
|
|
|
|
|
FieldState = FieldState.Watered;
|
|
|
|
|
_fieldSprite.Texture = Watered;
|
|
|
|
|
PlantingInteraction.IsActive = true;
|
|
|
|
|
PlantingInteraction.ProcessMode = ProcessModeEnum.Inherit;
|
|
|
|
|
break;
|
|
|
|
|
case FieldState.Planted:
|
|
|
|
|
FieldState = FieldState.Planted;
|
|
|
|
|
_fieldSprite.Texture = Tilled;
|
|
|
|
|
PlantingInteraction.IsActive = false;
|
|
|
|
|
PlantingInteraction.ProcessMode = ProcessModeEnum.Disabled;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
FieldState = FieldState.NotFound;
|
|
|
|
|
|