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

37 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 "";
}
}
}