ColliderArray2D
A collection of Collider2D.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Struct
- Namespace: UnityEngine
- Assembly: UnityEngine.Physics2DModule
- Implements: IEnumerable<Collider2D>, IEnumerable, IDisposable
public struct ColliderArray2D : IEnumerable<Collider2D>, IEnumerable, IDisposable
Remarks
The collection of Collider2D can be enumerated using "foreach" or its contents accessed via an indexer. The collection does not allocate any managed memory but must be disposed of.
This collection can only be created by Unity and is typically returned as results from physics queries.
Properties
Property | Description |
|---|---|
| this[] | An indexer allowing access to any Collider2D in the collection. |
| Length | The number of Collider2D elements in the collection. |
Methods
Method | Description |
|---|---|
| Dispose | Disposes of the native memory allocated by the collection. |
| GetEnumerator | Gets an enumerator which allows iteration of the collection. This is typically used implicitly by "foreach". |