Beispiel #1
0
 private void RemoveSwappableIfInventoryItem()
 {
     // if the swap managers swappable is an item
     if (swapManager.GetAttachedSwappable() is Item item)
     {
         // if the inventory has that exact item
         if (GetExactItem(item.guid) != null)
         {
             // return the item back to its slot
             swapManager.StopSwap();
         }
     }
 }
Beispiel #2
0
        private void OpenSellPanel()
        {
            // get the swappable attached to the mouse
            ISwappable swappable = swapManager.GetAttachedSwappable();

            // if there is a swappable and its an item
            if (swappable != null && swappable.GetType() == typeof(Item))
            {
                // open the sell panel with that item.
                Item item = (Item)swappable;
                Shop.OpenSellPanel(item);

                // return the attached item back to its slot
                swapManager.StopSwap();
            }
        }