Ultimate Replay Scripting Reference
ReplayManager Methods |
The ReplayManager type exposes the following members.
Methods
Name | Description | |
---|---|---|
BeginPlayback |
Use this method to begin the playback of the recorded objects.
Use SetPlaybackFrame(Single, PlaybackOrigin) or SetPlaybackFrameNormalized(Single, PlaybackOrigin) before calling this method to specify the exact location at which playback should begin.
This method will run the entire playback gathered and then automatically stop playback on completion if endReplayAfterPlayback is true.
|
|
BeginPlaybackFrame |
Use this method to set the current playback at a specific replay frame.
This will allow the state of a specific replay frame to be restored but will not continue playback which will provide a freeze frame effect.
Use SetPlaybackFrame(Single, PlaybackOrigin) or SetPlaybackFrameNormalized(Single, PlaybackOrigin) before calling this method to specify the exact location at which the playback frame should be sampled.
Use StopPlayback to unfreeze the still frame and return to normal game mode.
This method will ignore the value of endReplayAfterPlayback as only a single frame is replayed. As a result you will need to call StopPlayback when you want to end the playback frame.
|
|
BeginRecording |
Use this method to begin sampling the recorded objects in the scene.
If recordOnStart is true then this method will be called automatically when the manager is initialized.
Any state information will be recored via the assigned ReplayTarget (Default ReplayMemoryTarget).
When true, any previous recording data will be discarded
|
|
DiscardRecording |
This method will throw away any recorded data and flush the replay target if necessary.
This method can be called at any time.
If the manager is currently recording then all previous data will be discarded and recording will continue.
If the manager is currently replaying then all replay data will be discarded and playback will stop.
|
|
FindReplayPrefab |
Attempts to find the prefab with the matching name.
This is used to restore objects that were destroyed during recording.
|
|
ForceAwake |
Override implementation of ForceAwake.
Performs exactly the same behaviour.
Simply included so that the user does not need to import 'UltimateReplay.Util' to access the method.
|
|
OnDestroy |
Called by Unity.
Allows the active replay manager to cleanup any active recordings.
|
|
OnLevelWasLoaded |
Called by Unity.
Allows the active replay manager to cleanup recordings when a scene change is made.
|
|
OnValidate |
Called by Unity.
|
|
PausePlayback |
Use this method to pause replay playback while maintinaing the current replay state.
See ResumePlayback to continue a playback.
|
|
PauseRecording |
Use this method when you want to pause recording but may continue recording at any point.
A good candidate for pausing recording is when the user pauses the game and is shown a pause menu.
The manager must already be recording otherwise this method will have no effect.
|
|
RegisterReplayPrefab |
Attempts to register a game object as a prefab so that the replay system is able to spawn or despawn the object as needed.
You only need to do this for objects that are likley to be either instantiated or destroyed during recording.
The replay system will then be able to accuratley restore the scene state during playback.
The specified object must be a prefab otherwise an error will be thrown and the object will not be registered.
Prefab instances are not accepted.
|
|
ReplayDestroy |
Attempts to destroy the specified prefab.
OnReplayDestroy will be called if a listener has been registered otherwise default destruction will be used.
|
|
ReplayInstantiate |
Attempts to instantiate the specified prefab.
OnReplayInstantiate will be called if a listener has been registered otherwise default instantiation will be used.
|
|
ResumePlayback |
Use this method to resume playback after a previous call to PausePlayback was called.
If PausePlayback was not called prior to this method then the method will have no effect.
|
|
ResumeRecording |
Use this method to resume recording after a previous call to PauseRecording.
The manager must already be recording otherwise this method will have no effect.
|
|
SetPlaybackFrame |
Use this method to specify where in the replay sequence the playback should start.
If the offset does not lie within the bounds of the replay then the value will be clamped to represent either the start or end frame.
|
|
SetPlaybackFrameNormalized |
Use this method to specify where in the replay sequence the playback should start.
This method accepts normalized offsets values between 0 and 1 and performs validation before using the value.
|
|
Start |
Called by Unity.
Allows the active replay manager to initialize.
|
|
StopPlayback |
Use this method to stop any active playback.
This method will only have an effect if there is an active playback running otherwise it will have no effect.
|
|
StopRecording |
Use this method to stop recording after a previous call to BeginRecording(Boolean).
The manager must already be recording otherwise this method will have no effect.
This method must be called before attempting to playback otherwise you may get unpredicatable results.
|
|
Update |
Called by Unity.
Allows the active replay manager to update recoring or playback.
|
See Also