|
|
|
|
@ -39,7 +39,7 @@ public partial class FieldBehaviour2D : Sprite2D
|
|
|
|
|
case FieldState.Tilled:
|
|
|
|
|
FieldState = FieldState.Tilled;
|
|
|
|
|
_fieldSprite.Texture = Tilled;
|
|
|
|
|
PlantingInteraction.IsActive = false;
|
|
|
|
|
PlantingInteraction.IsActive = true;
|
|
|
|
|
break;
|
|
|
|
|
case FieldState.Watered:
|
|
|
|
|
FieldState = FieldState.Watered;
|
|
|
|
|
@ -67,15 +67,12 @@ public partial class FieldBehaviour2D : Sprite2D
|
|
|
|
|
/// Called when the player enters the field's interaction area and presses <E>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void Farm()
|
|
|
|
|
{
|
|
|
|
|
if (FieldState == FieldState.Watered)
|
|
|
|
|
{
|
|
|
|
|
if (TryPlant())
|
|
|
|
|
{
|
|
|
|
|
UpdateFieldState(FieldState.Planted);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool TryPlant()
|
|
|
|
|
{
|
|
|
|
|
@ -100,7 +97,6 @@ public partial class FieldBehaviour2D : Sprite2D
|
|
|
|
|
if (plantBehaviour != null)
|
|
|
|
|
{
|
|
|
|
|
plantBehaviour.Field = this;
|
|
|
|
|
plantBehaviour.Grow();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
success = true;
|
|
|
|
|
|