evelynshilosky

InteractableObject - Part 5

Feb 25th, 2025
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. public class InteractableObject : MonoBehaviour
  4. {
  5.     public Item item;
  6.  
  7.     public virtual void Interact(PlayerMovement playerMovement, bool isRightClick)
  8.     {
  9.         if (item != null)
  10.         {
  11.             if (isRightClick && item.isStorageItem)
  12.             {
  13.                 UIManager.Instance.ShowInventoryPrompt(item);
  14.             }
  15.             else
  16.             {
  17.                 playerMovement.GetComponent<InteractionSystem>().TryPickUpItem(this);
  18.             }
  19.         }
  20.     }
  21. }
  22.  
Add Comment
Please, Sign In to add comment