WIP trying to toggle interactable colliders at runtime for fields
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user