@@ -5,13 +5,11 @@ namespace BossRoom.Server
55{
66 /// <summary>
77 /// Provides various special commands that the Host can use while developing and
8- /// debugging the game. These are not compiled into release builds. (If you want
9- /// to disable them for debug builds, disable or remove this component from the
10- /// BossRoomState prefab.)
8+ /// debugging the game. To disable them, just disable or remove this component from the
9+ /// BossRoomState prefab.
1110 /// </summary>
1211 public class ServerTestingHotkeys : NetworkBehaviour
1312 {
14- #if UNITY_EDITOR || DEVELOPMENT_BUILD
1513 [ SerializeField ]
1614 [ Tooltip ( "Enemy to spawn. Make sure this is included in the NetworkManager's list of prefabs!" ) ]
1715 private NetworkObject m_EnemyPrefab ;
@@ -50,19 +48,18 @@ private void Update()
5048 if ( m_SpawnEnemyKeyCode != KeyCode . None && Input . GetKeyDown ( m_SpawnEnemyKeyCode ) )
5149 {
5250 var newEnemy = Instantiate ( m_EnemyPrefab ) ;
53- newEnemy . SpawnWithOwnership ( NetworkManager . Singleton . LocalClientId ) ;
51+ newEnemy . SpawnWithOwnership ( NetworkManager . Singleton . LocalClientId , null , true ) ;
5452 }
5553 if ( m_SpawnBossKeyCode != KeyCode . None && Input . GetKeyDown ( m_SpawnBossKeyCode ) )
5654 {
5755 var newEnemy = Instantiate ( m_BossPrefab ) ;
58- newEnemy . SpawnWithOwnership ( NetworkManager . Singleton . LocalClientId ) ;
56+ newEnemy . SpawnWithOwnership ( NetworkManager . Singleton . LocalClientId , null , true ) ;
5957 }
6058 if ( m_InstantQuitKeyCode != KeyCode . None && Input . GetKeyDown ( m_InstantQuitKeyCode ) )
6159 {
6260 GameStateRelay . SetRelayObject ( false ) ; // indicate to the post-game screen that the game was lost
6361 MLAPI . SceneManagement . NetworkSceneManager . SwitchScene ( "PostGame" ) ;
6462 }
6563 }
66- #endif
6764 }
6865}
0 commit comments