Ejemplo n.º 1
0
    IEnumerator KickCountdown()
    {
        yield return(new WaitForSecondsRealtime(timeToKickOut));

        if (!anyInputDone && GameManager.isClient)
        {
            Debug.Log("kicking");
            kicking = true;
            ClientInRoom.Exit();
        }
    }
Ejemplo n.º 2
0
 private void GoToMainMenu()
 {
     if (GameManager.isLocalGame)
     {
         SceneLoader.instance.LoadMainMenuScene();
         var players = FindObjectsOfType <Player>();
         foreach (var player in players)
         {
             Destroy(player.gameObject);
         }
     }
     else
     {
         ClientInRoom.Exit();
     }
 }
Ejemplo n.º 3
0
    public void ExitHub()
    {
        //Online game
        if (!GameManager.isLocalGame)
        {
            ClientInRoom.Exit();
        }
        //Local game
        else
        {
            Player[] players = FindObjectsOfType <Player>();

            foreach (Player player in players)
            {
                Destroy(player.gameObject);
            }

            SceneLoader.instance.LoadMainMenuScene();
        }
    }