PhysicsResultEnumerable<T, TFilter>
A lazy, allocation-free view over a physics result array that yields only the elements a filter keeps.
Read time 1 minuteLast updated 13 days ago
Definition
- Type: Struct
- Namespace: Unity.U2D.Physics
- Assembly: UnityEngine.PhysicsCore2DModule
public readonly ref struct PhysicsResultEnumerable<T, TFilter> where T : unmanaged where TFilter : IPhysicsResultFilter<T>
Remarks
This is a ref struct so it cannot escape to the heap, which keeps the enumeration Burst-compatible. It does not own the source array and never disposes it, so disposal stays with whoever created the results.
Constructors
Constructor | Description |
|---|---|
| PhysicsResultEnumerable`2(Unity.Collections.NativeArray{`0},`1) | Create a filtered view over a physics result array. |
Methods
Method | Description |
|---|---|
| GetEnumerator | Get an enumerator that walks the source array and yields only the kept elements. |
Structs
Struct | Description |
|---|---|
| PhysicsResultEnumerable<T, TFilter>.Enumerator | Walks a physics result array and yields only the elements the filter keeps. |