WIP trying to toggle interactable colliders at runtime for fields

This commit is contained in:
2025-06-15 18:59:38 +02:00
committed by cblech
parent 89ae347a91
commit e269b3ab44
2 changed files with 22 additions and 3 deletions
@@ -1,3 +1,4 @@
using Babushka.scripts.CSharp.Common.CharacterControls;
using Godot;
namespace Babushka.scripts.CSharp.Common.Farming;
@@ -17,6 +18,7 @@ public partial class FieldBehaviour2D : Sprite2D
[Export] private Texture2D Tilled;
[Export] private Texture2D Watered;
[Export] public FieldState FieldState = FieldState.Tilled;
[Export] private InteractionArea2D _growingCollider;
public Vector2 FieldPosition;
@@ -36,10 +38,12 @@ public partial class FieldBehaviour2D : Sprite2D
case FieldState.Tilled:
FieldState = FieldState.Tilled;
Texture = Tilled;
_growingCollider.Visible = false;
break;
case FieldState.Watered:
FieldState = FieldState.Watered;
Texture = Watered;
_growingCollider.Visible = true;
break;
case FieldState.Planted:
FieldState = FieldState.Planted;