Exemple #1
0
 protected virtual void CheckItem(vItemManager itemManager)
 {
     if (getItemByName)
     {
         if (itemManager.ContainItem(itemName))
         {
             onContains.Invoke();
         }
         else
         {
             onNotContains.Invoke();
         }
     }
     else
     {
         if (itemManager.ContainItem(itemID))
         {
             onContains.Invoke();
         }
         else
         {
             onNotContains.Invoke();
         }
     }
 }
Exemple #2
0
 protected virtual void CheckItem(vItemManager itemManager)
 {
     if (getItemByName)
     {
         // VERIFY IF YOU HAVE A SPECIFIC ITEM IN YOUR INVENTORY
         if (itemManager.ContainItem(itemName))
         {
             // AUTOMATICALLY EQUIP THE ITEM IF YOU HAVE IT
             //
             // - vItem can be access using the itemManager.GetItem(itemName)
             // - indexArea is the equipmentArea that you want to equip the item, for example 0 is RightArm, 1 is LeftArm, 2 is Consumable.
             // - Immediate is true to instantly equip the weapon or false to trigger the equip animation.
             itemManager.AutoEquipItem(itemManager.GetItem(itemName), 0, false);
             // trigger OnContains Event
             onContains.Invoke();
         }
         else
         {
             onNotContains.Invoke();
         }
     }
     else
     {
         // VERIFY IF YOU HAVE A SPECIFIC ITEM IN YOUR INVENTORY
         if (itemManager.ContainItem(itemID))
         {
             // AUTOMATICALLY EQUIP THE ITEM IF YOU HAVE IT
             //
             // - vItem can be access using the itemManager.GetItem(itemName)
             // - indexArea is the equipmentArea that you want to equip the item, for example 0 is RightArm, 1 is LeftArm, 2 is Consumable.
             // - Immediate is true to instantly equip the weapon or false to trigger the equip animation.
             itemManager.AutoEquipItem(itemManager.GetItem(itemID), 0, false);
             // trigger OnContains Event
             onContains.Invoke();
         }
         else
         {
             onNotContains.Invoke();
         }
     }
 }
Exemple #3
0
        vItem GetItem(vItemManager itemManager)
        {
            if (getItemByName)
            {
                // VERIFY IF YOU HAVE A SPECIFIC ITEM IN YOUR INVENTORY
                if (itemManager.ContainItem(itemName))
                {
                    return(itemManager.GetItem(itemName));
                }
            }
            else
            {
                // VERIFY IF YOU HAVE A SPECIFIC ITEM IN YOUR INVENTORY
                if (itemManager.ContainItem(itemID))
                {
                    return(itemManager.GetItem(itemID));
                }
            }

            return(null);
        }
Exemple #4
0
        vItem GetItem(vItemManager itemManager)
        {
            if (getItemByName)
            {
                // Check if you have an item via name (string) in your Inventory
                if (itemManager.ContainItem(itemName))
                {
                    return(itemManager.GetItem(itemName));
                }
            }
            else
            {
                // Check if you have an item via ID (integer) in your Inventory
                if (itemManager.ContainItem(itemID))
                {
                    return(itemManager.GetItem(itemID));
                }
            }

            return(null);
        }
            public bool Check(vItemManager itemManager)
            {
                bool _ContainItem = true;

                for (int i = 0; i < _itemsID.Count; i++)
                {
                    if (!itemManager.ContainItem(_itemsID[i]))
                    {
                        _ContainItem = false;
                        break;
                    }
                }
                return(_ContainItem);
            }
 /// <summary>
 /// Check if a item exists in the <seealso cref="itemManager"/>
 /// </summary>
 /// <param name="itemManager"></param>
 /// <returns>Contains or not</returns>
 protected bool ContainsItem(vItemManager itemManager)
 {
     return(desiredAmount > 1 ? (getItemByName ? itemManager.ContainItem(itemName, desiredAmount) : itemManager.ContainItem(itemID, desiredAmount)) :
            (getItemByName ? itemManager.ContainItem(itemName) : itemManager.ContainItem(itemID)));
 }