using System.Collections; using System.Collections.Generic; using UnityEngine; /// /// 库存物品 /// public class InventoryItem { /// 堆叠数量 public int stack = 1; /// 名字 public string name; /// 类型 public string type; /// 图片 public Sprite sprite; /// 预制件 public Transform prefabs; /// 是否可堆叠 public virtual bool IsStackable(InventoryItem item) { return name == item.name && type == item.type && stack > 1; } }