Первый коммит с LFS.
This commit is contained in:
1 parent
4fcb1e2f24
commit
179816dc4b
5084 files changed
+3714098
-1
No files matched your search
@@ -0,0 +1,41 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Quest_Environment.Q2
|
||||
{
|
||||
public class PickupBroomAction : MonoBehaviour, IInteractable
|
||||
{
|
||||
[Header("Settings")]
|
||||
public ItemData broomItemData;
|
||||
|
||||
public void Interact()
|
||||
{
|
||||
// Check if the current quest is the correct one for this item
|
||||
if (!(QuestManager.Instance?.currentQuest is Q2_SweepDirtQuest))
|
||||
{
|
||||
Debug.Log("I have no reason to pick this up right now.");
|
||||
return; // Do nothing if it's not the right quest
|
||||
}
|
||||
|
||||
bool added = InventorySystem.Instance.AddItem(broomItemData);
|
||||
|
||||
if (added)
|
||||
{
|
||||
if (InteractionHandler.Instance != null)
|
||||
{
|
||||
InteractionHandler.Instance.NotifyInteraction(gameObject);
|
||||
}
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
public string GetDescription()
|
||||
{
|
||||
// Only show the description if the correct quest is active
|
||||
if (QuestManager.Instance?.currentQuest is Q2_SweepDirtQuest)
|
||||
{
|
||||
return "Take the broom";
|
||||
}
|
||||
return ""; // Return empty string to hide the prompt
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user