Table of Contents

Class CollisionEventFilterExtensions

Namespace
LunyScript.Api
Assembly
LunyScript.dll
public static class CollisionEventFilterExtensions
Inheritance
object
CollisionEventFilterExtensions

Methods

Cooldown<T>(CollisionEventBuilder<T>, double)

Minimum seconds between successive reactions. Zero (default) means no cooldown. The cooldown is checked before collision predicates; evaluated per event sequence.

public static CollisionEventBuilder<CollisionReady> Cooldown<T>(this CollisionEventBuilder<T> b, double seconds) where T : struct, ICollisionFilterable

Parameters

b CollisionEventBuilder<T>
seconds double

Returns

CollisionEventBuilder<CollisionReady>

Type Parameters

T

Layered<T>(CollisionEventBuilder<T>, params string[])

Only react when the other object is on one of the given layers (OR logic). Mutually exclusive with Masked() — Masked() becomes unavailable after calling this.

public static CollisionEventBuilder<CollisionLayered> Layered<T>(this CollisionEventBuilder<T> b, params string[] layerNames) where T : struct, ICollisionFilterable

Parameters

b CollisionEventBuilder<T>
layerNames string[]

Returns

CollisionEventBuilder<CollisionLayered>

Type Parameters

T

Masked<T>(CollisionEventBuilder<T>, int)

Only react when the other object's layer is included in the given bitmask. Mutually exclusive with Layered() — unavailable after Layered() is called.

public static CollisionEventBuilder<CollisionMasked> Masked<T>(this CollisionEventBuilder<T> b, int layerMask) where T : struct, ICollisionFilterable

Parameters

b CollisionEventBuilder<T>
layerMask int

Returns

CollisionEventBuilder<CollisionMasked>

Type Parameters

T

Masked<T>(CollisionEventBuilder<T>, params string[])

Only react when the other object's layer name matches one of the given names (OR logic). Mutually exclusive with Layered() — unavailable after Layered() is called.

public static CollisionEventBuilder<CollisionMasked> Masked<T>(this CollisionEventBuilder<T> b, params string[] layerNames) where T : struct, ICollisionFilterable

Parameters

b CollisionEventBuilder<T>
layerNames string[]

Returns

CollisionEventBuilder<CollisionMasked>

Type Parameters

T

Tagged<T>(CollisionEventBuilder<T>, params string[])

Only react when the other object has one of the given tags (OR logic). Combine with other filter kinds for AND logic across kinds.

public static CollisionEventBuilder<CollisionReady> Tagged<T>(this CollisionEventBuilder<T> b, params string[] tags) where T : struct, ICollisionFilterable

Parameters

b CollisionEventBuilder<T>
tags string[]

Returns

CollisionEventBuilder<CollisionReady>

Type Parameters

T

Typed<T>(CollisionEventBuilder<T>, params Type[])

Only react when the other object's component list contains at least one of the given types (OR logic).

public static CollisionEventBuilder<CollisionReady> Typed<T>(this CollisionEventBuilder<T> b, params Type[] componentTypes) where T : struct, ICollisionFilterable

Parameters

b CollisionEventBuilder<T>
componentTypes Type[]

Returns

CollisionEventBuilder<CollisionReady>

Type Parameters

T

With<T>(CollisionEventBuilder<T>, params string[])

Only react when the other object's name matches one of the given names (OR logic).

public static CollisionEventBuilder<CollisionReady> With<T>(this CollisionEventBuilder<T> b, params string[] names) where T : struct, ICollisionFilterable

Parameters

b CollisionEventBuilder<T>
names string[]

Returns

CollisionEventBuilder<CollisionReady>

Type Parameters

T