Первый коммит с LFS.
This commit is contained in:
1 parent
4fcb1e2f24
commit
179816dc4b
5084 files changed
+3714098
-1
No files matched your search
@@ -0,0 +1,30 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class PickupBagAction : MonoBehaviour, IInteractable
|
||||
{
|
||||
[Header("Settings")]
|
||||
public ItemData bagItemData; // Reference to the bag's ScriptableObject
|
||||
|
||||
public void Interact()
|
||||
{
|
||||
// 1. Try to add the item to the inventory
|
||||
bool added = InventorySystem.Instance.AddItem(bagItemData);
|
||||
|
||||
if (added)
|
||||
{
|
||||
// 2. Notify the quest system that we interacted with this object
|
||||
// The quest itself will decide what to do next (e.g., show the bag in hand)
|
||||
if (InteractionHandler.Instance != null)
|
||||
{
|
||||
InteractionHandler.Instance.NotifyInteraction(gameObject);
|
||||
}
|
||||
}
|
||||
// If the item was not added (already exists or no space), do nothing.
|
||||
// A message about this is logged from the InventorySystem.
|
||||
}
|
||||
|
||||
public string GetDescription()
|
||||
{
|
||||
return "Pick up trash bags";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user