33 lines
640 B
C#
33 lines
640 B
C#
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;
|
|
}
|
|
} |