using Kryz.CharacterStats.Examples; using System; using System.Collections; using System.Collections.Generic; using UnityEditor; using UnityEngine; [System.Serializable] public class ItemInstance { public string ItemName; public Sprite Icon; public int spriteIndex; public int sellPricePlayer; public int sellPriceVendor; public string description; public int templateIndex; public ItemInstance() { ItemName = ""; Icon = null; spriteIndex = 0; sellPricePlayer = 0; sellPriceVendor = 0; description = ""; templateIndex = 0; } public ItemInstance(Item template) { ItemName = template.ItemName; Icon = template.Icon; spriteIndex = SpriteIndexer.Instance.Sprites.IndexOf(Icon); sellPricePlayer = template.sellPricePlayer; sellPriceVendor = template.sellPriceVendor; description = template.description; templateIndex = ItemIndexer.Instance.Items.IndexOf(template); } public ItemInstance(Item template, int templateIndex) { ItemName = template.ItemName; Icon = template.Icon; spriteIndex = SpriteIndexer.Instance.Sprites.IndexOf(Icon); sellPricePlayer = template.sellPricePlayer; sellPriceVendor = template.sellPriceVendor; description = template.description; this.templateIndex = templateIndex; } }