[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KGCF8Y3CFEEBQY9S5PY915":3,"skill-same:01M6KGCF8Y3CFEEBQY9S5PY915":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":51,"updatedAt":52,"install":53,"resources":65},"01M6KGCF8Y3CFEEBQY9S5PY915","wave5-stateful-physics-event-buffers",null,"Detect Enter, Stay, and Exit states for trigger and collision events using Unity Physics''s built-in stateful event buffer systems, which maintain per-entity DynamicBuffer\u003CStatefulTriggerEvent>.","dyCuong03\u002Funity-agent-team","dyCuong03","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F137050365?v=4","01M6KFXC85HQHXZJC2VC1KY6EZ","CuongND","01M6KFXCCHP6CD5MTA8NECJC36",8,"MIT","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Funity-dots\u002Fwave5-stateful-physics-event-buffers\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],"event","wave5 stateful physics event buffers","stateful","physics","systems","trigger","unity","events","detect","exit","states","true","which","buffer","entity","for","maintain","2026-11-10 10:12:30",false,"﻿---\nname: wave5-stateful-physics-event-buffers\ndescription: Detect Enter, Stay, and Exit states for trigger and collision events using Unity Physics''s built-in stateful event buffer systems, which maintain per-entity DynamicBuffer\u003CStatefulTriggerEvent>.\ntags: [physics]\nmetadata:\n  internal-only: true\n  tier: 3\n---\n\n# Stateful Physics Event Buffers\n\n## Intent\nDetect Enter, Stay, and Exit states for trigger and collision events using Unity Physics's built-in stateful event buffer systems, which maintain per-entity DynamicBuffer\u003CStatefulTriggerEvent>.\n\n## Use When\n- Trigger zones (enter\u002Fexit): pickups, portals, damage volumes\n- Collision events with Enter\u002FStay\u002FExit semantics: landing detection, impact response\n\n## Avoid When\n- Only \"something is overlapping this frame\" is needed — use SimulationSingleton.ScheduleCallbacks directly (cheaper, stateless)\n- Event count is very high (>10,000\u002Fframe) — the clear+collect+convert chain adds per-frame overhead\n\n## Setup Requirements\n- Add StatefulTriggerEventBufferAuthoring component to entities needing trigger event tracking.\n- Set PhysicsShapeAuthoring Collision Response = \"Raise Trigger Events\" on the trigger collider.\n- Unity Physics includes StatefulTriggerEventBufferSystem and StatefulCollisionEventBufferSystem built-in.\n\n## Senior Pattern\n```csharp\n[UpdateInGroup(typeof(FixedStepSimulationSystemGroup))]\n[UpdateAfter(typeof(StatefulTriggerEventBufferSystem))]\n[BurstCompile]\npublic partial struct TriggerZoneSystem : ISystem\n{\n    [BurstCompile]\n    public void OnUpdate(ref SystemState state)\n    {\n        state.Dependency = new ProcessTriggerJob().ScheduleParallel(state.Dependency);\n    }\n}\n\n[BurstCompile]\npublic partial struct ProcessTriggerJob : IJobEntity\n{\n    [BurstCompile]\n    public void Execute(ref TriggerZoneState zone,\n                        in DynamicBuffer\u003CStatefulTriggerEvent> events)\n    {\n        for (int i = 0; i \u003C events.Length; i++)\n        {\n            switch (events[i].State)\n            {\n                case StatefulEventState.Enter: zone.EnteredCount++; break;\n                case StatefulEventState.Exit:  zone.EnteredCount--; break;\n                \u002F\u002F StatefulEventState.Stay: fires every frame overlap persists — handle if needed\n            }\n        }\n    }\n}\n```\n\nEvent states:\n- StatefulEventState.Enter — first frame of overlap\n- StatefulEventState.Stay — overlap continues (fires every frame)\n- StatefulEventState.Exit — first frame overlap ends\n\n## Anti-Patterns\n- Reading DynamicBuffer\u003CStatefulTriggerEvent> before StatefulTriggerEventBufferSystem runs — empty buffer; always [UpdateAfter(StatefulTriggerEventBufferSystem)].\n- Forgetting StatefulTriggerEventBufferAuthoring — no buffer is created; events silently dropped.\n- Not filtering by ev.State == Enter — Stay events fire every frame overlap persists; unguarded code fires every frame.\n- Accessing buffer elements across frames — buffer is cleared and rebuilt every fixed tick.\n\n## Runtime Risks\n- Buffer cleared every fixed tick — do not cache references to buffer elements across frames.\n- StatefulTriggerEventExclude component on an entity suppresses event collection — use for performance optimization on high-frequency entities that don't need state tracking.\n- Both entities in a trigger pair receive events — guard against double-processing in symmetric handlers.\n\n## Performance Notes\n- Clear is parallel; collection and conversion are sequential — three-job chain per fixed tick.\n- Group trigger-zone entities in same archetype for buffer cache locality.\n- For very high event counts, prefer stateless SimulationSingleton.ScheduleCallbacks.\n\n## Architecture Guidance\n- Event detection: FixedStepSimulationSystemGroup [UpdateAfter(StatefulTriggerEventBufferSystem)].\n- Gameplay responses (VFX, audio via hybrid bridge): SimulationSystemGroup reading snapshot results from fixed step.\n- Collision events: same pattern with StatefulCollisionEventBufferSystem \u002F DynamicBuffer\u003CStatefulCollisionEvent>.\n\n## Related Skills\n[[wave5-fixed-step-simulation-system-group]], [[wave5-physics-velocity-force-application]], [[icleanupcomponentdata-runtime]], [[enableable-component]]\n","# Stateful Physics Event Buffers\n\n## Intent\nDetect Enter, Stay, and Exit states for trigger and collision events using Unity Physics's built-in stateful event buffer systems, which maintain per-entity DynamicBuffer\u003CStatefulTriggerEvent>.\n\n## Use When\n- Trigger zones (enter\u002Fexit): pickups, portals, damage volumes\n- Collision events with Enter\u002FStay\u002FExit semantics: landing detection, impact response\n\n## Avoid When\n- Only \"something is overlapping this frame\" is needed — use SimulationSingleton.ScheduleCallbacks directly (cheaper, stateless)\n- Event count is very high (>10,000\u002Fframe) — the clear+collect+convert chain adds per-frame overhead\n\n## Setup Requirements\n- Add StatefulTriggerEventBufferAuthoring component to entities needing trigger event tracking.\n- Set PhysicsShapeAuthoring Collision Response = \"Raise Trigger Events\" on the trigger collider.\n- Unity Physics includes StatefulTriggerEventBufferSystem and StatefulCollisionEventBufferSystem built-in.\n\n## Senior Pattern\n```csharp\n[UpdateInGroup(typeof(FixedStepSimulationSystemGroup))]\n[UpdateAfter(typeof(StatefulTriggerEventBufferSystem))]\n[BurstCompile]\npublic partial struct TriggerZoneSystem : ISystem\n{\n    [BurstCompile]\n    public void OnUpdate(ref SystemState state)\n    {\n        state.Dependency = new ProcessTriggerJob().ScheduleParallel(state.Dependency);\n    }\n}\n\n[BurstCompile]\npublic partial struct ProcessTriggerJob : IJobEntity\n{\n    [BurstCompile]\n    public void Execute(ref TriggerZoneState zone,\n                        in DynamicBuffer\u003CStatefulTriggerEvent> events)\n    {\n        for (int i = 0; i \u003C events.Length; i++)\n        {\n            switch (events[i].State)\n            {\n                case StatefulEventState.Enter: zone.EnteredCount++; break;\n                case StatefulEventState.Exit:  zone.EnteredCount--; break;\n                \u002F\u002F StatefulEventState.Stay: fires every frame overlap persists — handle if needed\n            }\n        }\n    }\n}\n```\n\nEvent states:\n- StatefulEventState.Enter — first frame of overlap\n- StatefulEventState.Stay — overlap continues (fires every frame)\n- StatefulEventState.Exit — first frame overlap ends\n\n## Anti-Patterns\n- Reading DynamicBuffer\u003CStatefulTriggerEvent> before StatefulTriggerEventBufferSystem runs — empty buffer; always [UpdateAfter(StatefulTriggerEventBufferSystem)].\n- Forgetting StatefulTriggerEventBufferAuthoring — no buffer is created; events silently dropped.\n- Not filtering by ev.State == Enter — Stay events fire every frame overlap persists; unguarded code fires every frame.\n- Accessing buffer elements across frames — buffer is cleared and rebuilt every fixed tick.\n\n## Runtime Risks\n- Buffer cleared every fixed tick — do not cache references to buffer elements across frames.\n- StatefulTriggerEventExclude component on an entity suppresses event collection — use for performance optimization on high-frequency entities that don't need state tracking.\n- Both entities in a trigger pair receive events — guard against double-processing in symmetric handlers.\n\n## Performance Notes\n- Clear is parallel; collection and conversion are sequential — three-job chain per fixed tick.\n- Group trigger-zone entities in same archetype for buffer cache locality.\n- For very high event counts, prefer stateless SimulationSingleton.ScheduleCallbacks.\n\n## Architecture Guidance\n- Event detection: FixedStepSimulationSystemGroup [UpdateAfter(StatefulTriggerEventBufferSystem)].\n- Gameplay responses (VFX, audio via hybrid bridge): SimulationSystemGroup reading snapshot results from fixed step.\n- Collision events: same pattern with StatefulCollisionEventBufferSystem \u002F DynamicBuffer\u003CStatefulCollisionEvent>.\n\n## Related Skills\n[[wave5-fixed-step-simulation-system-group]], [[wave5-physics-velocity-force-application]], [[icleanupcomponentdata-runtime]], [[enableable-component]]\n",{"name":5,"tags":41,"metadata":42,"description":7},[22],{"tier":43,"internal-only":44},3,true,"main","fe4746b9f07e6c7c2b6d3932002183af9b9f6fa2",".claude\u002Fskills\u002Funity-dots\u002Fwave5-stateful-physics-event-buffers",0,"https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team","https:\u002F\u002Fgithub.com\u002FdyCuong03","Game developer","2026-07-25 22:22:25",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":44},[55,58,61],{"tool":56,"command":57},"npx","npx skills add dyCuong03\u002Funity-agent-team --skill wave5-stateful-physics-event-buffers",{"tool":59,"command":60},"bunx","bunx skills add dyCuong03\u002Funity-agent-team --skill wave5-stateful-physics-event-buffers",{"tool":62,"command":63},"pnpm","pnpm dlx skills add dyCuong03\u002Funity-agent-team --skill wave5-stateful-physics-event-buffers","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Funity-dots\u002Fwave5-stateful-physics-event-buffers\u002FSKILL.md",[],[67,92,115,135,152,171],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":36},"01M6KH55FFS00ET877QSMRYGX4","dots-update-groups","How to choose the right ECS system group and ordering so per-frame and per-fixed-step work is deterministic and never races its own readers. Covers InitializationSystemGroup \u002F SimulationSystemGroup \u002F PresentationSystemGroup \u002F FixedStepSimulationSystemGroup \u002F VariableRateSimulationSystemGroup, UpdateBefore \u002F UpdateAfter peer ordering, OrderFirst \u002F OrderLast group-boundary placement, RateManager, and the cross-group ordering trap. Use when adding an ISystem, fixing \"value visible one frame late\" bugs, or coupling simulation to a fixed timestep.","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002Fworkspace\u002Fdots-program\u002Fscratch\u002Fwave-2-orchestrator-drafts\u002Fdots-update-groups\u002FSKILL.md",[],[74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91],"update","dots update groups","boundary","simulation","how","system","choose","work","use","never","peer","deterministic","how to","coupling","ecs","bugs","frame","value",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":36},"01M6KH50PWYEFQDCGYBZ0326F1","dots-transform-patterns","The Entities 1.x transform model — LocalTransform (writable input) vs LocalToWorld (system-owned matrix), Parent\u002FChild hierarchy, reparenting cost, uniform vs non-uniform scale (PostTransformMatrix), and when to opt out with custom transform systems. Use when designing parent\u002Fchild hierarchies, runtime reparenting (mount\u002Fdismount\u002Fsocket), or choosing transform components at the Baker boundary.","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002Fworkspace\u002Fdots-program\u002Fscratch\u002Fwave-2-orchestrator-drafts\u002Fdots-transform-patterns\u002FSKILL.md",[],[99,100,101,102,76,79,103,104,82,105,106,23,107,108,109,110,111,112,113,114],"patterns","transform","dots transform patterns","components","mount","model","cost","runtime","input","with","matrix","socket","at","child","custom","hierarchy",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":36},"01M6KH4VW4MA14DQW4KQYPFT0S","dots-singleton-patterns","Model cross-system shared configuration and game state as a single-entity component with a strict single-writer contract. Covers RequireForUpdate gating, SystemAPI.GetSingleton \u002F GetSingletonRW \u002F HasSingleton \u002F TryGetSingleton, bake-time vs runtime-created vs ECB-system singletons, the \"exactly one entity\" runtime invariant, and the single-writer rule. Use when designing frame-stable global config, shared mutable state, or any component intended to exist on exactly one entity.","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002Fworkspace\u002Fdots-program\u002Fscratch\u002Fwave-2-orchestrator-drafts\u002Fdots-singleton-patterns\u002FSKILL.md",[],[99,122,123,124,125,126,127,79,104,82,128,129,130,106,131,132,108,90,133,134],"singleton","dots singleton patterns","component","config","state","game","writer","time","shared","contract","as","ecb","gating",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":36},"01M6KH4PR076AYNDZHD63HHWX6","dots-hybrid-bridge","The one-way bridge between DOTS-owned runtime state and Unity-owned presentation. Covers UnityObjectRef for managed asset refs in components, the DOTS-writes \u002F Unity-reads ownership rule, when to use managed IComponentData vs UnityObjectRef vs CompanionComponent, baker-bridge vs runtime-bridge, and SubScene boundary rules. Use when an entity must reference Unity assets (Mesh, Material, AudioClip, ScriptableObject), a MonoBehaviour view must read entity state, or input\u002FUI must trigger ECS work.","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002Fworkspace\u002Fdots-program\u002Fscratch\u002Fwave-2-orchestrator-drafts\u002Fdots-hybrid-bridge\u002FSKILL.md",[],[142,143,144,145,102,126,76,146,147,81,148,149,82,106,24,25,107,150,34,151],"bridge","hybrid","dots hybrid bridge","mesh","assets","Rules","read","view","material","managed",{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":158,"publishedAt":36},"01M6KH4FGRQ9AP2ND5H5HX4D83","dots-event-driven-ecs","Model one-frame events and external requests in ECS without dual ownership, polling, or persistent state leaks. Covers request-tag pattern with ECB, enableable command components (no structural change), event buffers (IBufferElementData), explicit consumer ownership, one-frame latency rules, and the banned C# event \u002F UnityEvent \u002F static bus anti-patterns. Use when input\u002FUI\u002Fnetwork must trigger ECS work, when a one-frame signal fans out to N consumers (damage, hit, collision), or when state changes must be processed exactly once.","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002Fworkspace\u002Fdots-program\u002Fscratch\u002Fwave-2-orchestrator-drafts\u002Fdots-event-driven-ecs\u002FSKILL.md",[],[159,160,88,19,161,102,162,163,164,104,81,165,166,99,167,168,107,26,169,170],"event driven","driven","dots event driven ecs","change","ui","network","command","anti-patterns","pattern","structural","static","request",{"skillNo":172,"name":173,"nameZh":6,"description":174,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":175,"categories":176,"keywords":177,"publishedAt":36},"01M6KH4BWRGCEBJ8PKCKCSGT33","valid_skill","A complete, well-formed test fixture skill for SkillHub validation testing. Covers basic task routing and code review for Unity projects.","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fvalid_skill\u002FSKILL.md",[],[178,179,180,181,182,183,184,185,186,187,188,189,190,191,25,192,34],"valid skill","valid","code review","testing","review","test","routing","code","validation","projects","fixture skill","task","fixture","basic","complete"]