Added cash counter

This commit is contained in:
2026-03-30 13:44:46 +01:00
parent 59b64a680f
commit 652df5ce01
8 changed files with 1016 additions and 11 deletions

View File

@@ -29,6 +29,14 @@ namespace Fruitomation
private void OnPlayerClicked() => TriggerDestruction();
private void Update()
{
if (!GameStateController.Is(GameState.Simulation))
{
TriggerDestruction();
}
}
private void FixedUpdate()
{
bool contained = IsWithinCanvas(RectTransform, AttachedCanvas.GetComponent<RectTransform>());
@@ -42,6 +50,8 @@ namespace Fruitomation
private void TriggerDestruction()
{
MoneyController.Add((ulong)Random.Range(1, 5));
Spawner.RemoveFruit(this);
Destroy(gameObject);
}