Added cash counter
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user