EditModeLauncherContextSettings.cs 703 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using UnityEngine;
  3. namespace UnityEditor.TestTools.TestRunner
  4. {
  5. internal class EditModeLauncherContextSettings : IDisposable
  6. {
  7. private bool m_RunInBackground;
  8. public EditModeLauncherContextSettings()
  9. {
  10. SetupProjectParameters();
  11. }
  12. public void Dispose()
  13. {
  14. CleanupProjectParameters();
  15. }
  16. private void SetupProjectParameters()
  17. {
  18. m_RunInBackground = Application.runInBackground;
  19. Application.runInBackground = true;
  20. }
  21. private void CleanupProjectParameters()
  22. {
  23. Application.runInBackground = m_RunInBackground;
  24. }
  25. }
  26. }