// Methods public override void Awake() { base.Awake(); // Create a rolling memory buffer of 10 seconds killcamStorage = ReplayMemoryTarget.CreateTimeLimitedRolling(recordKillcamSeconds); // Start recording killcamHandle = ReplayManager.BeginRecording(killcamStorage); }
// Methods public void Start() { // Create a memory storage target to store the replay ReplayStorageTarget storage = new ReplayMemoryTarget(); // Begin recording to the specified storage target. // We should store the returned replay handle as all other replay operations will expect this value as a parameter to identify the recording // By default, all replay objects in the active scene will be recorded. recordHandle = ReplayManager.BeginRecording(storage); }
// Methods public IEnumerator Start() { for (int i = 0; i < 5; i++) { ReplayMemoryTarget storage = new ReplayMemoryTarget(); // Record some gameplay ReplayHandle handle = ReplayManager.BeginRecording(storage); // Wait for some data to be recorded yield return(new WaitForSeconds(3)); // End the recording ReplayManager.StopRecording(ref handle); // Add storage highlightsStorage.Add(storage); } }
// Methods public IEnumerator Start() { ReplayMemoryTarget storage = new ReplayMemoryTarget(); // Record as normal ReplayHandle handle = ReplayManager.BeginRecording(storage); // Allow recording to run for 1 second yield return(new WaitForSeconds(1f)); // Stop recording // We need to pass the handle to the recording as a reference which will cause the handle to become invalid ReplayManager.StopRecording(ref handle); // Begin playback of the recording that we captured in the storage target // Again this method will return a replay handle that is required for many other playback operations playbackHandle = ReplayManager.BeginPlayback(storage); }