GlobalGameJame/Library/PackageCache/com.unity.test-framework@1.1.9/UnityEditor.TestRunner/TestRun/Tasks/SaveModiedSceneTask.cs
JonatanRek bea2dce063 Initial
test
2020-01-31 16:10:04 +01:00

22 lines
637 B
C#

using System;
using System.Collections;
using UnityEditor.SceneManagement;
namespace UnityEditor.TestTools.TestRunner.TestRun.Tasks
{
internal class SaveModiedSceneTask : TestTaskBase
{
internal Func<bool> SaveCurrentModifiedScenesIfUserWantsTo =
EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo;
public override IEnumerator Execute(TestJobData testJobData)
{
var cancelled = !SaveCurrentModifiedScenesIfUserWantsTo();
if (cancelled)
{
throw new TestRunCanceledException();
}
yield break;
}
}
}