Afterparty/Assets/Scripts/Quest Environment/Q3/PickupRagAction.cs
2026-01-11 17:04:23 +03:00

39 lines
1015 B
C#

using UnityEngine;
namespace Quest_Environment.Q3
{
public class PickupRagAction : MonoBehaviour, IInteractable
{
[Header("Settings")]
public ItemData ragItemData;
public void Interact()
{
if (!(QuestManager.Instance?.currentQuest is Q3_WipeSurfacesQuest))
{
Debug.Log("I have no reason to pick this up right now.");
return;
}
bool added = InventorySystem.Instance.AddItem(ragItemData);
if (added)
{
if (InteractionHandler.Instance != null)
{
InteractionHandler.Instance.NotifyInteraction(gameObject);
}
Destroy(gameObject);
}
}
public string GetDescription()
{
if (QuestManager.Instance?.currentQuest is Q3_WipeSurfacesQuest)
{
return "Take the rag";
}
return "";
}
}
}