No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

EnterPlayModeTask.cs 770B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. using System.Collections;
  3. using UnityEngine;
  4. namespace UnityEditor.TestTools.TestRunner.TestRun.Tasks
  5. {
  6. internal class EnterPlayModeTask : TestTaskBase
  7. {
  8. public Func<bool> IsInPlayMode = () => Application.isPlaying;
  9. public Action EnterPlayMode = () => EditorApplication.isPlaying = true;
  10. public override IEnumerator Execute(TestJobData testJobData)
  11. {
  12. if (IsInPlayMode())
  13. {
  14. yield break;
  15. }
  16. // Give the UI a change to update the progress bar, sa entering playmode freezes.
  17. yield return null;
  18. EnterPlayMode();
  19. while (!IsInPlayMode())
  20. {
  21. yield return null;
  22. }
  23. }
  24. }
  25. }