Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions Assets/BossRoom/Scripts/Server/ServerTestingHotkeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ namespace BossRoom.Server
{
/// <summary>
/// Provides various special commands that the Host can use while developing and
/// debugging the game. These are not compiled into release builds. (If you want
/// to disable them for debug builds, disable or remove this component from the
/// BossRoomState prefab.)
/// debugging the game. To disable them, just disable or remove this component from the
/// BossRoomState prefab.
/// </summary>
public class ServerTestingHotkeys : NetworkBehaviour
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
[SerializeField]
[Tooltip("Enemy to spawn. Make sure this is included in the NetworkManager's list of prefabs!")]
private NetworkObject m_EnemyPrefab;
Expand Down Expand Up @@ -50,19 +48,18 @@ private void Update()
if (m_SpawnEnemyKeyCode != KeyCode.None && Input.GetKeyDown(m_SpawnEnemyKeyCode))
{
var newEnemy = Instantiate(m_EnemyPrefab);
newEnemy.SpawnWithOwnership(NetworkManager.Singleton.LocalClientId);
newEnemy.SpawnWithOwnership(NetworkManager.Singleton.LocalClientId, null, true);
}
if (m_SpawnBossKeyCode != KeyCode.None && Input.GetKeyDown(m_SpawnBossKeyCode))
{
var newEnemy = Instantiate(m_BossPrefab);
newEnemy.SpawnWithOwnership(NetworkManager.Singleton.LocalClientId);
newEnemy.SpawnWithOwnership(NetworkManager.Singleton.LocalClientId, null, true);
}
if (m_InstantQuitKeyCode != KeyCode.None && Input.GetKeyDown(m_InstantQuitKeyCode))
{
GameStateRelay.SetRelayObject(false); // indicate to the post-game screen that the game was lost
MLAPI.SceneManagement.NetworkSceneManager.SwitchScene("PostGame");
}
}
#endif
}
}