Skip to content

Record Components

Rory Clark edited this page May 6, 2021 · 1 revision

Playback

Playback logic occurs in several places. As with recording, there is a function that happens during the Tick of the playback called PlayTickLogic and a function during the Update called PlayUpdateLogic. As most of the information is being set to Unity components and behaviours, you'll find most of the time you will be relying on the PlayUpdateLogic function.

Most RecordComponent scripts will have multiple parts that need updating during the PlayUpdateLogic function, but iterating over each one and repeatedly setting the same data is inefficient. To help alleviate this, each RecordComponent automatically generates a list of updated RecordPart indexes during each playback Tick. This can be found as the _playUpdatedParts list, which is a list of integers that reference the index of RecordPart objects within the RecordItem object. It is automatically wiped after each PlayUpdateLogic method call, and also decides whether said method is ever called. If there are no items in the _playUpdatedParts list, then PlayUpdateLogic will never be called.