Added item registry

This commit is contained in:
2026-04-18 12:52:28 +01:00
parent 1908024332
commit cd7f16f021
29 changed files with 187 additions and 53 deletions

View File

@@ -1,21 +1,8 @@
using System;
using Fruitomation.Global;
using UnityEngine;
namespace Fruitomation.Game.Items
{
public enum ItemType
{
Apple,
Grape,
Banana,
Kiwi,
Mango,
Pitaya,
Durian,
BuddhasHand
}
public class ItemBehaviour : MonoBehaviour
{
protected RectTransform RectTransform { get; private set; }
@@ -99,6 +86,13 @@ namespace Fruitomation.Game.Items
public void TriggerDestruction(bool harvest = true)
{
if (harvest)
{
ItemInfo info = ItemInfoRegistry.Get(CurrentType);
float money = Random.Range(info.MinMoney, info.MaxMoney);
MoneyController.Add(money);
}
Destroy(gameObject);
}
}