Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ColliderArray2D

A collection of Collider2D.
Read time 1 minuteLast updated 6 days ago

Definition

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.
LengthThe number of Collider2D elements in the collection.

Methods

Method

Description

DisposeDisposes of the native memory allocated by the collection.
GetEnumeratorGets an enumerator which allows iteration of the collection. This is typically used implicitly by "foreach".