Добавил открытие элементов кузова
This commit is contained in:
1 parent
66ddcda5d6
commit
a33b4cd5f5
15 files changed
+1390
-97
No files matched your search
@@ -0,0 +1,18 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user