Files
zeling_v2/Assets/_Game/Scripts/World/TeleportStation.cs
2026-05-19 11:50:21 +08:00

34 lines
1.3 KiB
C#
Raw Permalink 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;
using BaseGames.Core;
using BaseGames.Core.Events;
namespace BaseGames.World
{
/// <summary>
/// 传送点。玩家互动后打开快速旅行面板(由 UIManager 响应 EVT_FastTravelOpen
/// 与存档点SavePoint完全独立传送点不存档、不复活、不恢复 HP。
/// </summary>
public class TeleportStation : MonoBehaviour, IInteractable
{
[Header("Config")]
[Tooltip("传送站唯一 ID用于地图 UI 显示和解锁状态查询")]
[SerializeField] private string _stationId;
[Header("Event Channels - Raise")]
[Tooltip("EVT_FastTravelOpen — 触发后由 UIManager 打开快速旅行面板")]
[SerializeField] private VoidEventChannelSO _onFastTravelOpen;
// ── IInteractable ──────────────────────────────────────────────────────
public bool CanInteract => true;
public string InteractPrompt => "快速旅行";
public void Interact(Transform player)
{
_onFastTravelOpen?.Raise();
}
public void OnPlayerEnterRange(Transform player) { }
public void OnPlayerExitRange() { }
}
}