Files
OGG/Assets/Scripts/ItemDefinition.cs

29 lines
927 B
C#

using UnityEngine;
/// <summary>
/// Create via right-click → Create → OGG → Item Definition
/// Drag onto PickupItem components in the scene.
/// </summary>
[CreateAssetMenu(fileName = "New Item", menuName = "OGG/Item Definition")]
public class ItemDefinition : ScriptableObject
{
public enum ItemType { Misc, Consumable, Weapon }
[Header("Identity")]
public string itemName = "Unnamed Item";
public Sprite icon;
public ItemType type = ItemType.Misc;
[Header("Weapon (only if type == Weapon)")]
[Tooltip("The prefab that gets spawned in the weapon holder when this is equipped.")]
public GameObject weaponPrefab;
[Header("Equipment")]
[Tooltip("If true, this item can be equipped/unequipped from the inventory even if it isn't a weapon.")]
public bool isEquippable = false;
[Header("Flavour")]
[TextArea(2, 4)]
public string description = "";
}