Files
BookRPG/Library/PackageCache/com.unity.test-framework@76560ee600cb/UnityEditor.TestRunner/TestRun/Tasks/SetInteractionModeTask.cs

25 lines
957 B
C#
Raw Normal View History

2026-07-16 21:49:59 +01:00
using System.Collections;
using System.Reflection;
namespace UnityEditor.TestTools.TestRunner.TestRun.Tasks
{
internal class SetInteractionModeTask : TestTaskBase
{
private const string ApplicationIdleTimeKey = "ApplicationIdleTime";
private const string InteractionModeKey = "InteractionMode";
public override IEnumerator Execute(TestJobData testJobData)
{
SetInteractionModeToNoThrottling(testJobData);
EditorApplication.UpdateInteractionModeSettings();
yield break;
}
private void SetInteractionModeToNoThrottling(TestJobData testJobData)
{
testJobData.UserApplicationIdleTime = EditorPrefs.GetInt(ApplicationIdleTimeKey);
testJobData.UserInteractionMode = EditorPrefs.GetInt(InteractionModeKey);
EditorPrefs.SetInt(ApplicationIdleTimeKey, 0);
EditorPrefs.SetInt(InteractionModeKey, 1);
}
}
}