using Unity.Entities; using Unity.Mathematics; namespace jeanf.universalplayer { /// /// Data for a seat that was authored inside a SubScene and baked to an entity. /// The anchors are separate entities so their baked world pose (position AND facing) /// survives exactly; reads their LocalToWorld at runtime. /// public struct SeatComponent : IComponentData { /// The Seat's authored scenario-targeting id (0 = not targetable), baked as-is /// so can resolve "sit at seat N" requests by id. public int SeatId; public float EyeHeight; /// Hips position + facing. Never null (the baker falls back to the seat root). public Entity SitAnchor; /// Where the player stands on exit; when unset. public Entity ExitAnchor; /// Hand rest reached with IK during the glide; when unset. public Entity HandSupportAnchor; // Chair collider, baked from the Seat's BoxCollider and reproduced on a runtime proxy so // the GameObject-side raycast / hover can hit a baked seat. Local to the seat root transform. public float3 ColliderSize; public float3 ColliderCenter; public byte HasCollider; /// The seat GameObject's layer, so the proxy sits on the same physics layer. public int Layer; } /// /// A that was authored inside a SubScene. The MonoBehaviour is /// stripped at runtime (baked SubScenes keep entities only), so its intent is baked to data and /// executes it when the entity streams in — the entity-world /// equivalent of "OnEnable": force-sit the player the moment this object's section is loaded. /// public struct ForceSitOnLoad : IComponentData { /// The directly-linked seat (same SubScene); when targeting by id. public Entity Seat; /// Authored Seat Id fallback for seats the SubScene cannot reference; 0 = unset. public int SeatId; public byte FadeToBlack; public float HoldBlackSeconds; } }