Первый коммит с LFS.
This commit is contained in:
1 parent
4fcb1e2f24
commit
179816dc4b
5084 files changed
+3714098
-1
No files matched your search
@@ -0,0 +1,34 @@
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// A simple component that makes an object interactable
|
||||
/// and just notifies the InteractionHandler that it has been interacted with.
|
||||
/// Ideal for objects that don't have complex logic but need to be recognized
|
||||
/// by the quest system (e.g., a dumpster).
|
||||
/// </summary>
|
||||
public class NotifyInteractionObject : MonoBehaviour, IInteractable
|
||||
{
|
||||
[SerializeField]
|
||||
private string description = "Interact";
|
||||
|
||||
public void Interact()
|
||||
{
|
||||
// Check if InteractionHandler exists
|
||||
if (InteractionHandler.Instance != null)
|
||||
{
|
||||
// Notify the system that this object (gameObject) has been interacted with.
|
||||
// The QuestManager, subscribed to this event, will receive the notification.
|
||||
InteractionHandler.Instance.NotifyInteraction(gameObject);
|
||||
Debug.Log($"Interaction notified for {gameObject.name}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("InteractionHandler.Instance is not found in the scene.");
|
||||
}
|
||||
}
|
||||
|
||||
public string GetDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user