Beispiel #1
0
        public void ReplayHighlights()
        {
            if (replayHighlightIndex >= 0 && replayHighlightIndex < highlightsStorage.Count)
            {
                isReplayingHighlights = true;
                replayHighlightIndex  = 0;

                // Start replaying highlights
                replayHighlightHandle = ReplayManager.BeginPlayback(highlightsStorage[replayHighlightIndex]);

                // Add listener for playback finished
                ReplayManager.AddPlaybackEndListener(replayHighlightHandle, OnHighlightPlaybackFinished);
            }
        }
        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);
        }
Beispiel #3
0
        private void OnHighlightPlaybackFinished()
        {
            // Increase storage index
            replayHighlightIndex++;

            if (replayHighlightIndex >= 0 && replayHighlightIndex < highlightsStorage.Count)
            {
                // Start replaying highlights
                replayHighlightHandle = ReplayManager.BeginPlayback(highlightsStorage[replayHighlightIndex]);

                // Add listener for playback finished
                ReplayManager.AddPlaybackEndListener(replayHighlightHandle, OnHighlightPlaybackFinished);
            }
            else
            {
                isReplayingHighlights = false;
                replayHighlightIndex  = 0;
                replayHighlightHandle = ReplayHandle.invalid;
            }
        }
Beispiel #4
0
        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);
        }