DelayedImpactResolver
A static class in Root.Township, Alta.Impact.
Collects every collision an impact tool makes in a frame and turns them into one best hit in LateUpdate, so a swing touching several colliders only hits once. ImpactDetector feeds it.
- Listed in Items, inventory and logic
- Nested types
ImpactDetectorHit - Documented in Impacts and hit detection
Fields
5 private and internal fields
| Member | What it is |
|---|---|
private static Dictionary<ImpactTool, List<DelayedImpactResolver.ImpactDetectorHit>> frameHits | Collisions queued this frame, grouped per impact tool. |
private static Stack<List<DelayedImpactResolver.ImpactDetectorHit>> hitsPool | Reused hit lists, to avoid allocating each frame. |
private static Logger logger | Class logger, used when generating a hit throws. |
private static IUnityUpdateMethod update | The registered late update, or null when stopped. |
private static UpdateModule updateModule | The LateUpdate module named "Impact Detector Resolver". |
Methods
| Member | What it is |
|---|---|
static void Hit(ImpactTool tool, ImpactDetector impactDetector, Collision collision) | Queues a tool's collision with a detector for this frame and makes sure the late update is running. |
static void ProcessImmediate(ImpactTool impactTool, ImpactDetector impactDetector, Collision collision, Action<ImpactHitWithTool> hitProcessor) | Picks the most effective hit from one collision right away and passes it to the callback. Used for tools that need instant processing. |
static void Stop() | Deregisters the late update and drops any queued hits. |
3 private and internal methods
| Member | What it is |
|---|---|
private static void PushHitsListIntoPool(List<DelayedImpactResolver.ImpactDetectorHit> hits) | Clears a hit list and returns it to the pool. |
private static void Start() | Registers Update with the update module if it isn't already. |
private static void Update() | Late update: for each tool, keeps the most effective hit across all its queued collisions, applies it, then resets that tool's impact generators. |