Skip to main content

Class CollisionDataLoggable

A MonoBehaviour that accumulates collision events and exposes them to the data-collection pipeline via IDataLoggable.

[DisallowMultipleComponent]
public class CollisionDataLoggable : MonoBehaviour, IDataLoggable

Inheritance​

Implements​

IDataLoggable

Remarks​

Collision events are buffered locally rather than sent immediately because the data pipeline enforces a single in-flight HTTP request at a time. Collect is called by a DataCollector at scenario end (or on a scheduled interval), at which point the buffer is drained and returned as a CollisionDataLog ready for serialisation.

DisallowMultipleComponent prevents duplicate log entries from appearing in the data stream if a designer accidentally adds the component more than once.

Methods​

Collect()​

Drains the accumulated collision buffer and returns it as a CollisionDataLog ready for JSON serialisation, then clears the buffer so the next interval starts fresh. Returns null when no collisions have occurred, signalling the pipeline that there is nothing to transmit for this actor in this interval.

public DataLog Collect()

Returns​

DataLog