Ultimate Replay Scripting Reference
ReplayMemoryTarget Class |
Represents a memory storage buffer where replay data can be stored for game sessions.
The buffer can be used as a continuous rolling buffer of a fixed size where a fixed amount of playback footage is recorded and then overwritten by new data as it is received.
Inheritance Hierarchy
SystemObject Object
Component
Behaviour
MonoBehaviour
UltimateReplayReplayBehaviour
UltimateReplay.StorageReplayTarget
UltimateReplay.StorageReplayMemoryTarget
Component
Behaviour
MonoBehaviour
UltimateReplayReplayBehaviour
UltimateReplay.StorageReplayTarget
UltimateReplay.StorageReplayMemoryTarget
Namespace: UltimateReplay.Storage
Assembly: UltimateReplay (in UltimateReplay.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
[SerializableAttribute] public class ReplayMemoryTarget : ReplayTarget
The ReplayMemoryTarget type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ReplayMemoryTarget | Initializes a new instance of the ReplayMemoryTarget class |
Methods
Name | Description | |
---|---|---|
PrepareTarget |
Clears all state information for the current recording essentially restoring the memory target to its initial state.
(Overrides ReplayTargetPrepareTarget(ReplayTargetTask).) | |
RecordSnapshot |
Store a replay snapshot in the replay target.
If the new snapshot causes the internal buffer to 'overflow' then the recoding clip will be wrapped so that the recording duration is no more than recordSeconds.
(Overrides ReplayTargetRecordSnapshot(ReplaySnapshot).) | |
RestoreSnapshot |
Recall a snapshot from the replay target based on the specified replay offset.
(Overrides ReplayTargetRestoreSnapshot(Single).) |
Fields
Name | Description | |
---|---|---|
recordSeconds |
The amount of time in seconds of recording that should be kept in memory before it is discarded.
The time is measured backwards from the current time to give a rolling buffer of the last 'n' seconds.
This is useful in situations where you are only need the previous few secnonds of gameplay to be recorded for example: A kill cam.
If this value is set to 0 then the internal buffer will not be wrapped at all. You should take extra care when using an unconstrained buffer as there is potential to run into an OutOfMemoryException, especially on mobile platforms where memory is at a premium.
|
Properties
Name | Description | |
---|---|---|
Duration |
The amount of time in seconds that the recording lasts.
Usually this value will be equal to recordSeconds however it will take atleast the amount of recordSeconds to initially fill the buffer before it wraps around.
(Overrides ReplayTargetDuration.) | |
MemorySize |
Get the amount of size in bytes that this memory target requires for all state data.
This size does not include internal structures used to store the data but exclusivley contains game state sizes.
(Overrides ReplayTargetMemorySize.) |
See Also