Beispiel #1
0
    Inventory GetInventory(Unit unit)
    {
        Inventory inv = null;

        if (item_lootable.GetItemType() == ItemTypes.dust)
        {
            inv = PlayerInventory.Instance;
        }
        else
        {
            inv = unit.GetComponent <UnitInventory>();
        }

        return(inv);
    }
Beispiel #2
0
    public override void SetItem(object obj)
    {
        IInventoryItem item = obj as IInventoryItem;

        Title.text = item.GetItemType().ToString();
        descr.text = "BLa bla bla";
    }
Beispiel #3
0
 void UpdatedInventory(IInventoryItem item, int count)
 {
     if (item.GetItemType() == ItemType)
     {
         UpdateResource(item.GetCount());
     }
 }
Beispiel #4
0
 void UpdatedInventory(IInventoryItem item, int count)
 {
     if (item.GetItemType() == ItemTypes.rest_pack && count > 0 && CanShowStimpackPrompt())
     {
         ShowStimpackPrompt();
     }
 }
Beispiel #5
0
    public override void AddItem(IInventoryItem item, int count)
    {
        if (item.GetItemType() == ItemTypes.weapon)
        {
            EquipedWeapon = item as Weapon;
        }

        base.AddItem(item, count);
    }
Beispiel #6
0
    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();
         }
     }
 }
Beispiel #8
0
    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()));
            }
        }
    }
Beispiel #9
0
 public ItemTypes GetItemType()
 {
     return(m_item.GetItemType());
 }