Table of Contents

Struct PhysicsEventBuilder<T>

Namespace
LunyScript.Api
Assembly
LunyScript.dll

Fluent builder for filtered collision/trigger event sequences. Filters (Tagged, Named, Layered, Masked, Typed) are order-independent and accumulate. Event handlers (Begins, Updates, Ends) are also order-independent. Parameters within a filter kind are OR-combined; different kinds are AND-combined.

public readonly struct PhysicsEventBuilder<T> where T : struct, ICollisionBuilderState

Type Parameters

T

Methods

Begins(params ScriptActionBlock[])

Blocks to run when the collision/trigger begins.

public PhysicsEventBuilder<CollisionBuilderReady> Begins(params ScriptActionBlock[] blocks)

Parameters

blocks ScriptActionBlock[]

Returns

PhysicsEventBuilder<CollisionBuilderReady>

Continues(params ScriptActionBlock[])

Blocks to run each physics step while the collision/trigger persists.

public PhysicsEventBuilder<CollisionBuilderReady> Continues(params ScriptActionBlock[] blocks)

Parameters

blocks ScriptActionBlock[]

Returns

PhysicsEventBuilder<CollisionBuilderReady>

Cooldown(double)

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

public PhysicsEventBuilder<CollisionBuilderReady> Cooldown(double seconds)

Parameters

seconds double

Returns

PhysicsEventBuilder<CollisionBuilderReady>

Ends(params ScriptActionBlock[])

Blocks to run when the collision/trigger ends.

public PhysicsEventBuilder<CollisionBuilderReady> Ends(params ScriptActionBlock[] blocks)

Parameters

blocks ScriptActionBlock[]

Returns

PhysicsEventBuilder<CollisionBuilderReady>

Layered(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 PhysicsEventBuilder<CollisionBuilderLayered> Layered(params string[] layerNames)

Parameters

layerNames string[]

Returns

PhysicsEventBuilder<CollisionBuilderLayered>

Tagged(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 PhysicsEventBuilder<CollisionBuilderReady> Tagged(params string[] tags)

Parameters

tags string[]

Returns

PhysicsEventBuilder<CollisionBuilderReady>

Typed(params Type[])

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

public PhysicsEventBuilder<CollisionBuilderReady> Typed(params Type[] componentTypes)

Parameters

componentTypes Type[]

Returns

PhysicsEventBuilder<CollisionBuilderReady>

With(params string[])

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

public PhysicsEventBuilder<CollisionBuilderReady> With(params string[] names)

Parameters

names string[]

Returns

PhysicsEventBuilder<CollisionBuilderReady>