UnityBiz/Assets/scripts/Inventory/Item.cs

33 lines
640 B
C#
Raw Normal View History

2024-08-02 04:41:41 +00:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Item : MonoBehaviour
{
public enum ItemType
{
BluePotion,
UnicornHorn,
}
public ItemType itemType;
public int amount;
public Sprite GetSprite()
{
switch (itemType)
{
default:
case ItemType.BluePotion: return ItemAssets.Instance.PotionBlueSprite;
}
}
public void AddAmount(int amountToAdd)
{
amount += amountToAdd;
}
public void RemoveAmount(int amountToRemove)
{
amount -= amountToRemove;
}
}