Skip to content

Commit 41eec00

Browse files
fix: SceneBootstrapper detects and allows TestRunner launches (#483)
* SceneBootstrapper detects and allows TestRunner launches * narrowing test runner usage down to presence of TestRunner scene
1 parent 9bf5772 commit 41eec00

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Assets/BossRoom/Scripts/Editor/SceneBootstrapper.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public class SceneBootstrapper
3434
const string k_LoadBootstrapSceneOnPlay = "Boss Room/Load Bootstrap Scene On Play";
3535
const string k_DoNotLoadBootstrapSceneOnPlay = "Boss Room/Don't Load Bootstrap Scene On Play";
3636

37+
const string k_TestRunnerSceneName = "InitTestScene";
38+
3739
static bool s_StoppingAndStarting;
3840

3941
static string BootstrapScene
@@ -99,6 +101,11 @@ static void DisableDoNotLoadBootstrapSceneOnPlay()
99101

100102
static void EditorApplicationOnplayModeStateChanged(PlayModeStateChange obj)
101103
{
104+
if (IsTestRunnerActive())
105+
{
106+
return;
107+
}
108+
102109
if (!LoadBootstrapScene)
103110
{
104111
return;
@@ -157,5 +164,10 @@ static void EditorApplicationOnplayModeStateChanged(PlayModeStateChange obj)
157164
}
158165
}
159166
}
167+
168+
static bool IsTestRunnerActive()
169+
{
170+
return EditorSceneManager.GetActiveScene().name.StartsWith(k_TestRunnerSceneName);
171+
}
160172
}
161173
}

0 commit comments

Comments
 (0)