Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
 /// <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();
     }
 }
Ejemplo n.º 3
0
        public void Teardown()
        {
            if (result != null)
            {
                result.Close();
            }

            if (TestableEditorElements.Mode == TestableEditorElements.DisplayMode.Playback)
            {
                TestableEditorElements.StopPlayback();
            }

            AdditionalTeardown();
        }