예제 #1
0
 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);
     }
 }
예제 #2
0
    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();
    }