chore: initial commit
This commit is contained in:
29
Assets/Scripts/Core/Events/LiquidEvent.cs
Normal file
29
Assets/Scripts/Core/Events/LiquidEvent.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
namespace BaseGames.Core.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// 液体区域事件负载。用于玩家进入/离开液体区域时传递区域信息。
|
||||
/// </summary>
|
||||
public readonly struct LiquidEvent
|
||||
{
|
||||
/// <summary>液体区域标识符(对应 LiquidZone SO 的 zoneId)。</summary>
|
||||
public readonly string ZoneId;
|
||||
/// <summary>液体类型(如 "Water" / "Acid" / "Lava")。</summary>
|
||||
public readonly string LiquidType;
|
||||
|
||||
public LiquidEvent(string zoneId, string liquidType)
|
||||
{
|
||||
ZoneId = zoneId;
|
||||
LiquidType = liquidType;
|
||||
}
|
||||
|
||||
public override string ToString() => $"LiquidEvent(Zone={ZoneId}, Type={LiquidType})";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 液体进出事件频道(EVT_LiquidEntered / EVT_LiquidExited)。
|
||||
/// 发布:LiquidZone(OnTriggerEnter2D / OnTriggerExit2D)
|
||||
/// 订阅:PlayerController(切换游泳状态)、DrownSystem、AudioManager
|
||||
/// </summary>
|
||||
[UnityEngine.CreateAssetMenu(menuName = "Events/LiquidEvent")]
|
||||
public class LiquidEventChannelSO : BaseEventChannelSO<LiquidEvent> { }
|
||||
}
|
||||
Reference in New Issue
Block a user