first commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace OTGIntegrated.Items
|
||||
{
|
||||
public enum ItemType
|
||||
{
|
||||
Resource,
|
||||
Consumable,
|
||||
Weapon,
|
||||
Quest,
|
||||
Crafted
|
||||
}
|
||||
|
||||
[CreateAssetMenu(fileName = "ItemData", menuName = "OTG Integrated/Item Data")]
|
||||
public sealed class ItemData : ScriptableObject
|
||||
{
|
||||
public string itemId;
|
||||
public string displayName;
|
||||
[TextArea(2, 5)] public string description;
|
||||
[Min(1)] public int maxStack = 20;
|
||||
public ItemType itemType = ItemType.Resource;
|
||||
public Color itemColor = Color.white;
|
||||
public Sprite icon;
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(itemId))
|
||||
{
|
||||
itemId = name;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(displayName))
|
||||
{
|
||||
displayName = itemId;
|
||||
}
|
||||
|
||||
maxStack = Mathf.Max(1, maxStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user