Files
Project-M/Assets/_Project/Scripts/Simulation/World/ExpeditionGate.cs
T
2026-06-03 22:41:27 -07:00

29 lines
1.2 KiB
C#

using Unity.Entities;
using Unity.Mathematics;
namespace ProjectM.Simulation
{
/// <summary>
/// A walk-in travel gate between world regions. A baked entity (visible mesh + this component) at a fixed
/// position; the server <c>ExpeditionGateSystem</c> transits a player who walks within <see cref="Radius"/>
/// and whose region matches <see cref="FromRegion"/> to <see cref="ToRegion"/>, placing them at
/// <see cref="ArrivalPos"/> (offset from the destination gate so they do not immediately re-trigger).
/// Returning to the base during the Expedition phase also starts Defend early (the "timer cap + early
/// return" pacing).
/// </summary>
public struct ExpeditionGate : IComponentData
{
/// <summary>Region a player must currently be in for this gate to act on them (see <see cref="RegionId"/>).</summary>
public byte FromRegion;
/// <summary>Region the player is transited to.</summary>
public byte ToRegion;
/// <summary>Planar (XZ) trigger radius in world units.</summary>
public float Radius;
/// <summary>World position the player arrives at in the destination region.</summary>
public float3 ArrivalPos;
}
}