Files
Perekyp/Assets/Scripts/Car/Interaction/CarPartInteractable.cs
T

18 lines
493 B
C#
Raw Normal View History

using UnityEngine;
using System;
public class CarPartInteractable : MonoBehaviour, IInteractable
{
[SerializeField] private string promptMessage = "Открыть (E)";
// Чистое C# событие
public event Action OnInteract;
public string GetPrompt() => promptMessage;
public void Interact(GameObject interactor)
{
// Вызываем событие, если на него кто-то подписан
OnInteract?.Invoke();
}
}