void OnInventoryChanged() { Dictionary.Clear(); for (int i = 0; i < Inventory.Items.Count; i++) { if (Items.Upgrades.IsUpgradable(Inventory.Items[i].Template.CatalogItem)) { var data = new ItemUpgradesData(Inventory.Items[i]); if (Dictionary.ContainsKey(Inventory.Items[i].Template)) { Debug.LogWarning("Duplicate Unit found, duplicate: " + Inventory.Items[i].Template); continue; } Dictionary.Add(Inventory.Items[i].Template, data); } } }
public virtual void Init() { Upgrades = new ItemUpgradesData(template, rank); }
public virtual void Set(ItemUpgradesData data) { this.Data = data; }