Added Wellbehaviour and fixed door interaction to offer outlines
This commit is contained in:
@@ -0,0 +1 @@
|
||||
uid://cqtlic8xxtvkc
|
||||
@@ -0,0 +1 @@
|
||||
uid://dw5dl5yscbyaw
|
||||
@@ -23,6 +23,10 @@ public static class WateringCanState
|
||||
/// Triggers animations and ui.
|
||||
/// </summary>
|
||||
public static bool Active = false;
|
||||
|
||||
public delegate void WateringCanDelegate(bool state);
|
||||
public static event WateringCanDelegate WateringCanActiveStateChanged;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -65,6 +69,8 @@ public static class WateringCanState
|
||||
/// <param name="active"></param>
|
||||
public static void SetActive(bool active)
|
||||
{
|
||||
if(active != Active)
|
||||
WateringCanActiveStateChanged?.Invoke(active);
|
||||
Active = active;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using Babushka.scripts.CSharp.Common.CharacterControls;
|
||||
using Godot;
|
||||
|
||||
namespace Babushka.scripts.CSharp.Common.Farming;
|
||||
|
||||
public partial class WellBehaviour : Node2D
|
||||
{
|
||||
[Export] private InteractionArea2D _interactionArea;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
WateringCanState.WateringCanActiveStateChanged += OnWateringCanStateChanged;
|
||||
}
|
||||
|
||||
private void OnWateringCanStateChanged(bool state)
|
||||
{
|
||||
_interactionArea.IsActive = state;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://boehox1ydbcnx
|
||||
Reference in New Issue
Block a user