37 lines
1.4 KiB
C#
37 lines
1.4 KiB
C#
using UnityEngine;
|
||
|
||
namespace Quest_Environment.Q4
|
||
{
|
||
[RequireComponent(typeof(Outline))]
|
||
public class MovableFurniture : MonoBehaviour, IInteractable
|
||
{
|
||
[Tooltip("A unique ID for this piece of furniture (e.g., 'Chair', 'Lamp').")]
|
||
[SerializeField] private string furnitureId;
|
||
|
||
public void Interact()
|
||
{
|
||
// Проверяем, что сейчас идет квест с мебелью, прежде чем что-то делать
|
||
if (QuestManager.Instance?.currentQuest is Q4_PlaceFurnitureQuest)
|
||
{
|
||
InteractionHandler.Instance.NotifyInteraction(gameObject);
|
||
}
|
||
}
|
||
|
||
public string GetDescription()
|
||
{
|
||
// Описание будет только если активен квест по расстановке мебели
|
||
if (QuestManager.Instance?.currentQuest is Q4_PlaceFurnitureQuest furnitureQuest)
|
||
{
|
||
// И если игрок ничего не "держит" в руках
|
||
if (furnitureQuest.HeldFurnitureId == null)
|
||
{
|
||
return $"Подобрать {furnitureId}";
|
||
}
|
||
}
|
||
|
||
// В противном случае возвращаем пустую строку, и подсветки не будет
|
||
return "";
|
||
}
|
||
}
|
||
}
|