Skip to content

Commit 9206577

Browse files
SceneBootstrapper detects and allows TestRunner launches
1 parent 372dda4 commit 9206577

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Assets/BossRoom/Scripts/Editor/SceneBootstrapper.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using UnityEditor;
22
using UnityEditor.SceneManagement;
33
using UnityEngine;
4+
using UnityEngine.SceneManagement;
45

56
namespace Unity.Multiplayer.Samples.BossRoom.Editor
67
{
@@ -99,6 +100,15 @@ static void DisableDoNotLoadBootstrapSceneOnPlay()
99100

100101
static void EditorApplicationOnplayModeStateChanged(PlayModeStateChange obj)
101102
{
103+
// detects whether playmode has been initiated by a TestRunner Playmode test; if so disable Boostrap loading
104+
for (int i = 0; i < SceneManager.sceneCount; i++)
105+
{
106+
if (SceneManager.GetSceneAt(i).name.Contains("InitTestScene"))
107+
{
108+
return;
109+
}
110+
}
111+
102112
if (!LoadBootstrapScene)
103113
{
104114
return;

0 commit comments

Comments
 (0)