Inventory GetInventory(Unit unit) { Inventory inv = null; if (item_lootable.GetItemType() == ItemTypes.dust) { inv = PlayerInventory.Instance; } else { inv = unit.GetComponent <UnitInventory>(); } return(inv); }
public override void SetItem(object obj) { IInventoryItem item = obj as IInventoryItem; Title.text = item.GetItemType().ToString(); descr.text = "BLa bla bla"; }
void UpdatedInventory(IInventoryItem item, int count) { if (item.GetItemType() == ItemType) { UpdateResource(item.GetCount()); } }
void UpdatedInventory(IInventoryItem item, int count) { if (item.GetItemType() == ItemTypes.rest_pack && count > 0 && CanShowStimpackPrompt()) { ShowStimpackPrompt(); } }
public override void AddItem(IInventoryItem item, int count) { if (item.GetItemType() == ItemTypes.weapon) { EquipedWeapon = item as Weapon; } base.AddItem(item, count); }
public virtual void AddItem(IInventoryItem item, int count) { if (Items == null) { Items = new List <ItemInInventory>(); } if (!HasItem(item.GetItemType(), 0)) { Items.Add(new ItemInInventory(item, count)); } }
void OnLoot(IInventoryItem item, int count) { if (item.GetItemType() == type) { count += count; if (count >= LootAmount) { if (_spawned_arrow != null) { GameObject.Destroy(_spawned_arrow); } m_Unit.Inventory.OnInventoryUpdated -= OnLoot; GlobalUpdateDispatcher.OnUpdate -= _update; Complete(); } } }
public virtual void AddItem(IInventoryItem item, bool use_saved) { if (Items == null) { Items = new List <ItemInInventory>(); } if (!HasItem(item.GetItemType(), 0)) { if (use_saved) { Items.Add(new ItemInInventory(item)); } else { Items.Add(new ItemInInventory(item, item.GetCount())); } } }
public ItemTypes GetItemType() { return(m_item.GetItemType()); }