UnityGame/Library/PackageCache/com.unity.test-framework/UnityEditor.TestRunner/TestRun/Tasks/PreparePlayModeRunTask.cs
2024-10-27 10:53:47 +03:00

28 lines
854 B
C#

using System;
using System.Collections;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace UnityEditor.TestTools.TestRunner.TestRun.Tasks
{
internal class PreparePlayModeRunTask : TestTaskBase
{
public override IEnumerator Execute(TestJobData testJobData)
{
testJobData.OriginalProjectSettings = new TestJobData.SavedProjectSettings
{
consoleErrorPaused = ConsoleWindow.GetConsoleErrorPause(),
runInBackgroundValue = Application.runInBackground
};
ConsoleWindow.SetConsoleErrorPause(false);
Application.runInBackground = true;
if (testJobData.InitTestScene.IsValid())
{
SceneManager.SetActiveScene(testJobData.InitTestScene);
}
yield break;
}
}
}