Show / Hide Table of Contents

Class CollisionCounter

Monitors and tracks collisions with 2D colliders.

Inheritance
object
Object
Component
Behaviour
MonoBehaviour
CollisionCounter
Implements
IOnPool
Namespace: WeaverCore.Components
Assembly: WeaverCore.dll
Syntax
public class CollisionCounter : MonoBehaviour, IOnPool

Properties

| Edit this page View Source

CollidedObjectCount

Gets the count of currently collided objects.

Declaration
public int CollidedObjectCount { get; }
Property Value
Type Description
int
| Edit this page View Source

CollidedObjects

Gets the collection of colliders that the object has collided with.

Declaration
public IEnumerable<Collider2D> CollidedObjects { get; }
Property Value
Type Description
IEnumerable<Collider2D>

Methods

| Edit this page View Source

GetNearestTarget(Vector3)

Finds the nearest target collider based on the given source position.

Declaration
public Collider2D GetNearestTarget(Vector3 sourcePos)
Parameters
Type Name Description
Vector3 sourcePos

The source position from which to find the nearest target.

Returns
Type Description
Collider2D

The nearest target collider or null if none found.

| Edit this page View Source

OnPool()

Clears the list of collided objects when the object is pooled.

Declaration
public void OnPool()

Implements

IOnPool

Extension Methods

ReflectionUtilities.ReflectCallMethod(object, string, object[], BindingFlags)
ReflectionUtilities.ReflectGetField(object, string, BindingFlags)
ReflectionUtilities.ReflectGetMethod(object, string, BindingFlags)
ReflectionUtilities.ReflectGetProperty(object, string, BindingFlags)
ReflectionUtilities.ReflectSetField(object, string, object, BindingFlags)
ReflectionUtilities.ReflectSetProperty(object, string, object, BindingFlags)
CoroutineUtilities.RunCoroutineWhile<T>(T, IEnumerator, Func<bool>)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Generated by DocFX
☀
☾