Class CollisionEventFilterExtensions
- Namespace
- LunyScript.Api
- Assembly
- LunyScript.dll
public static class CollisionEventFilterExtensions
- Inheritance
-
objectCollisionEventFilterExtensions
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
bCollisionEventBuilder<T>secondsdouble
Returns
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
bCollisionEventBuilder<T>layerNamesstring[]
Returns
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
bCollisionEventBuilder<T>layerMaskint
Returns
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
bCollisionEventBuilder<T>layerNamesstring[]
Returns
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
bCollisionEventBuilder<T>tagsstring[]
Returns
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
bCollisionEventBuilder<T>componentTypesType[]
Returns
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
bCollisionEventBuilder<T>namesstring[]
Returns
Type Parameters
T