Added event handlers in Fieldbehaviour to react to watering can state changes
This commit is contained in:
@@ -30,6 +30,7 @@ public static class WateringCanState
|
||||
public static event WateringCanDelegate WateringCanActiveStateChanged;
|
||||
public static event Action? OnWater;
|
||||
public static event Action? OnFill;
|
||||
public static event Action? OnEmpty;
|
||||
|
||||
|
||||
|
||||
@@ -52,6 +53,11 @@ public static class WateringCanState
|
||||
_fillstate--;
|
||||
OnWater?.Invoke();
|
||||
}
|
||||
|
||||
if (_fillstate == 0)
|
||||
{
|
||||
OnEmpty?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user