Files
2025TapTapGameJam/Assets/Script/Gameplay/Facility/InteractableBaseController.cs

30 lines
794 B
C#

using UnityEngine;
using Script.Gameplay.Interface;
namespace Script.Gameplay.Facility
{
public abstract class InteractableBaseController : MonoBehaviour, IInteractable
{
public bool Interactable = true;
public string GetInteractPrompt()
{
return "按F进行交互";
}
public virtual void Interact(GameObject interactor)
{
if (!Interactable) return;
Debug.Log($"{gameObject.name} 被 {interactor.name} 交互了!");
}
public void OnGazeEnter(GameObject editor)
{
// 修改鼠标指针或高亮显示物体等
}
public void OnGazeExit(GameObject editor)
{
// 恢复鼠标指针或取消高亮显示物体等
}
}
}