/
TON618OFF
/
Unity-Project-RTU
Обзор
Документация
Войти
/
TON618OFF
/
Unity-Project-RTU
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Library/PackageCache/com.unity.test-framework@1.1.33/UnityEditor.TestRunner/TestRunner/Callbacks/TestRunnerCallback.cs
37 строк
1 KB
TON618OFF
release
03 окт 2024, 22:20
03 окт 2024, 22:20
7c70e9f
Код
Авторство
О чём код?
using NUnit.Framework.Interfaces; using UnityEngine; using UnityEngine.TestTools.TestRunner; namespace UnityEditor.TestTools.TestRunner { internal class TestRunnerCallback : ScriptableObject, ITestRunnerListener { public void RunStarted(ITest testsToRun) { EditorApplication.playModeStateChanged += OnPlayModeStateChanged; } private void OnPlayModeStateChanged(PlayModeStateChange state) { if (state == PlayModeStateChange.ExitingPlayMode) { EditorApplication.playModeStateChanged -= OnPlayModeStateChanged; //We need to make sure we don't block NUnit thread in case we exit PlayMode earlier PlaymodeTestsController.TryCleanup(); } } public void RunFinished(ITestResult testResults) { EditorApplication.isPlaying = false; } public void TestStarted(ITest testName) { } public void TestFinished(ITestResult test) { } } }