public void ResetKillcam() { // Stop recording if (ReplayManager.IsRecording(killcamHandle) == true) { ReplayManager.StopRecording(ref killcamHandle); } killcamStorage.Clear(); killcamHandle = ReplayManager.BeginRecording(killcamStorage); }
public void PlayKillcam() { // Stop recording if (ReplayManager.IsRecording(killcamHandle) == true) { ReplayManager.StopRecording(ref killcamHandle); } // Start replaying killcamHandle = ReplayManager.BeginPlayback(killcamStorage); isReplaying = true; // Activate camera killcamViewCamera.enabled = true; killcamViewCanvas.gameObject.SetActive(true); killcamViewCamera.GetComponent <AudioListener>().enabled = true; ReplayManager.AddPlaybackEndListener(killcamHandle, OnKillcamEnd); }
public void OnTriggerEnter(Collider other) { Debug.LogWarning("Trigger"); // Stop replaying if (ReplayManager.IsReplaying(playbackHandle) == true) { ReplayManager.StopPlayback(ref playbackHandle); } // Stop recording if (ReplayManager.IsRecording(recordHandle) == true) { // Stop recording ReplayManager.StopRecording(ref recordHandle); playbackStorage = recordStorage; recordStorage = new ReplayMemoryTarget(); Debug.Log("Recording Length: " + playbackStorage.Duration); // Enable the ghost car ghostCar.gameObject.SetActive(true); // Clone identities - This allows the ghost car to be replayed as the player car ReplayObject.CloneReplayObjectIdentity(playerCar, ghostCar); // Start replaying playbackHandle = ReplayManager.BeginPlayback(playbackStorage, playbackScene); // Add end playback listener ReplayManager.AddPlaybackEndListener(playbackHandle, OnGhostVehiclePlaybackComplete); } // Start recording recordHandle = ReplayManager.BeginRecording(recordStorage, recordScene); }