private void OnGUI() { if (Event.current.type == EventType.ExecuteCommand && Event.current.commandName == "Wait") { TestableEditorElements.StopPlayback(); Event.current.Use(); } if (Event.current.type != EventType.ExecuteCommand) { return; } if (Event.current.commandName != "Finished") { return; } if (Finished != null) { Finished(this, new FinishedEventArgs(window)); } window.Close(); Close(); }
/// <summary> /// Start sending <paramref name="recordedActions"/> to the <see cref="window"/> and invoke <paramref name="finishedCallback"/> when done. /// </summary> public static void StartPlayback(EditorWindow window, IList <UserAction> recordedActions) { foreach (UserAction action in recordedActions) { TestableEditorElements.StartPlayback(action.PrepickedSelections); window.RepaintImmediately(); window.SendEvent(action.Event); TestableEditorElements.StopPlayback(); } }
public void Teardown() { if (result != null) { result.Close(); } if (TestableEditorElements.Mode == TestableEditorElements.DisplayMode.Playback) { TestableEditorElements.StopPlayback(); } AdditionalTeardown(); }