public override void Cleanup() { base.Cleanup(); if (RecordedPlaybackController.Exists()) { RecordedPlaybackController.Instance.Reset(); } }
public void Reset() { _instance = null; Initialized = false; if (ReportingManager.IsPlaybackStartedFromEditorWindow) { GameObject inputObj = new List <GameObject>(FindObjectsOfType <GameObject>()).Find(x => x != gameObject && x.GetComponent <BaseInputModule>() && x.GetComponent <EventSystem>()); if (inputObj != null) { EventSystem gameEventSystem = inputObj.GetComponent <EventSystem>(); if (RecordingInputModule.Instance != null) { RecordingInputModule.Instance.GetComponent <EventSystem>().enabled = false; } gameEventSystem.enabled = true; inputObj.GetComponent <BaseInputModule>().enabled = true; EventSystem.current = inputObj.GetComponent <EventSystem>(); } } DestroyImmediate(gameObject); }
private IEnumerator PlayRecording(string recordingFileName) { // Load scene var recordingData = RecordedPlaybackPersistentData.GetRecordingData <RecordingInputModule.InputModuleRecordingData>(); RecordedPlaybackPersistentData.RecordedResolution = recordingData.recordedResolution; RecordedPlaybackPersistentData.RecordedAspectRatio = recordingData.recordedAspectRatio; yield return(LoadEntryScene(recordingData)); if (RecordedPlaybackController.Exists()) { // Reset controller if a previous recording just finished playing RecordedPlaybackController.Instance.Reset(); } RecordedPlaybackPersistentData.SetRecordingMode(RecordingMode.Playback, recordingFileName); RecordedPlaybackController.Instance.Begin(); while (!RecordedPlaybackController.IsPlaybackCompleted()) { yield return(null); } EndAutomation(); }