public override void OnEvent(LoseGameEvent evnt) // called whenever a player loses! { evnt.Player.GetComponent <Bolt_PlayerController>().Teleport(SpawnPositionManager.instance.LobbySpawnPosition.position); if (BoltNetwork.IsServer) { GameManager.instance.PlayerLost(evnt.Player); } }
public void LoseGame() { if (!entity.IsOwner) { return; } //print("LOST THE GAME!"); state.LostGame = true; // disable the UI here. GameUI.UserInterface.HealthUI.transform.parent.gameObject.SetActive(false); // disable the health bar if you lost! var evnt = LoseGameEvent.Create(); evnt.Player = GetComponent <BoltEntity>(); evnt.Send(); }