23 lines
705 B
C#
23 lines
705 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
[CreateAssetMenu(fileName = "New Item", menuName = "Inventory/Item")]
|
|
public class Item : ScriptableObject, IComparable<Item> {
|
|
public string displayName;
|
|
public string description;
|
|
public int id; //TODO: create an actual ID System that makes snens
|
|
public Sprite selectedSprite;
|
|
public Sprite defaultSprite;
|
|
public int price;
|
|
public int SellPrice => Convert.ToInt32(price * 0.8);
|
|
|
|
public Item(string displayName, string description, int id) {
|
|
this.displayName = displayName;
|
|
this.description = description;
|
|
this.id = id;
|
|
}
|
|
|
|
public int CompareTo(Item other) {
|
|
return this.id - other.id;
|
|
}
|
|
}
|