void OnExitPlaymode()
        {
            Button        recordButton       = rootVisualElement.Q <Button>("RecordButton");
            Button        reportButton       = rootVisualElement.Q <Button>("ReportButton");
            Button        saveSegmentButton  = rootVisualElement.Q <Button>("SaveButton");
            Button        endButton          = rootVisualElement.Q <Button>("EndButton");
            List <Button> recordingStateBtns = new List <Button>()
            {
                saveSegmentButton,
                endButton
            };

            BulkButtonDisplayUpdate(recordingStateBtns, DisplayStyle.None);
            recordButton.style.display = DisplayStyle.Flex;
            if (ReportingManager.DoesReportExist(ReportingManager.ReportType.Html))
            {
                reportButton.style.display      = DisplayStyle.Flex;
                reportButton.clickable.clicked += () => { HandleOpenHtmlReportClick(); };
                reportButton.SetEnabled(true);
            }

            if (playModeStartedFromHere)
            {
                if (RecordedPlaybackPersistentData.GetRecordingMode() == RecordingMode.Record ||
                    RecordedPlaybackPersistentData.GetRecordingMode() == RecordingMode.Extend)
                {
                    RecordedPlaybackEditorUtils.SaveCurrentRecordingDataAsProjectAsset();
                }

                RecordedPlaybackPersistentData.SetRecordingMode(RecordingMode.None);
            }

            playModeStartedFromHere = false;
            SetupViews();
        }
Exemplo n.º 2
0
 void StopRecording(PlayModeStateChange state = PlayModeStateChange.ExitingPlayMode)
 {
     if (state == PlayModeStateChange.ExitingPlayMode)
     {
         RecordingInputModule.Instance.EndRecording();
         if (isRecording || ReportingManager.IsCrawler)
         {
             recordingPaths = recordingPaths.AddAtAndReturnNewList(0, $"Assets/Recordings/{RecordedPlaybackEditorUtils.SaveCurrentRecordingDataAsProjectAsset()}");
             firstRecordingListedIsBrandNew = true;
         }
         GameCrawler.Stop           = true;
         ReportingManager.IsCrawler = renderStopButton = isRecording = false;
         SetUpView();
     }
 }