63 lines
1.3 KiB
C#
63 lines
1.3 KiB
C#
using UnityEngine;
|
|
|
|
// Example: GameItem.cs
|
|
|
|
[CreateAssetMenu(fileName = "GameItem", menuName = "Game Data/Game Item")]
|
|
public class GameItem : ScriptableObject
|
|
{
|
|
// item types
|
|
public enum ItemType
|
|
{
|
|
Quest,
|
|
Key,
|
|
Weapon,
|
|
Helmet,
|
|
Armor,
|
|
Boots,
|
|
Gloves,
|
|
Accessory,
|
|
Ring,
|
|
Consumable,
|
|
Stone,
|
|
Gatherable,
|
|
Crops,
|
|
Tool
|
|
}
|
|
|
|
|
|
public string name;
|
|
public Sprite icon;
|
|
public int itemValue;
|
|
public string rarity; // todo: maybe like enum type?
|
|
public string quantity;
|
|
public int maxStack;
|
|
public int sellValue;
|
|
|
|
public ItemType type;
|
|
|
|
public bool isStackable;
|
|
public bool isEquippable;
|
|
public bool isConsumable;
|
|
public bool isQuestItem;
|
|
public bool isKeyItem;
|
|
public bool isCraftable;
|
|
public bool isTradeable;
|
|
public bool isSellable;
|
|
public bool isDroppable;
|
|
public bool isDestroyable;
|
|
public bool isUsable;
|
|
|
|
// stat properties
|
|
public int attack;
|
|
public int defense;
|
|
public int speed;
|
|
public int luck;
|
|
public int magic;
|
|
public int sanity;
|
|
public int health; // ex. if consumable heals for 10 health or if equipment adds 10 health
|
|
public int experience;
|
|
|
|
// set how long the item will last
|
|
public int durability;
|
|
public int maxDurability;
|
|
} |