Beispiel #1
0
    private void ErrorKartNotSelected()
    {
        string      title    = "ERROR";
        string      message  = "Not all players have selected a kart. Wait for them to choose a kart.";
        UnityAction okAction = () =>
        {
            MainMenuHandler.EnableInputReceive();
            Destroy(mainMenuHandler.dialogInstance);
        };

        mainMenuHandler.ShowErrorDialog(title, message, okAction);
    }
Beispiel #2
0
 void OnDisconnectedFromServer(NetworkDisconnection info)
 {
     foreach (NetworkView networkView in FindObjectsOfType <NetworkView>())
     {
         if (networkView.stateSynchronization != NetworkStateSynchronization.Off)
         {
             Destroy(networkView.gameObject);
         }
     }
     if (Network.isClient)
     {
         if (info == NetworkDisconnection.Disconnected)
         {
             MainMenuHandler.DisableAllCanvases();
             string      title    = "SERVER CLOSED";
             string      message  = "The host left the game.";
             UnityAction okAction = () =>
             {
                 Destroy(mainMenuHandler.dialogInstance);
                 MainMenuHandler.EnableInputReceive();
                 mainMenuHandler.GoToMainMenu();
             };
             mainMenuHandler.ShowErrorDialog(title, message, okAction);
         }
     }
 }
Beispiel #3
0
    void OnFailedToConnect(NetworkConnectionError error)
    {
        string      title    = "CONNECTION FAILED";
        string      message  = "Failed to connect to server. Either server doesn't exist or network has problems.";
        UnityAction okAction = ConnectionFailedConfirm;

        mainMenuHandler.ShowErrorDialog(title, message, okAction);
    }
Beispiel #4
0
    public void CreateGame()
    {
        if (selectedGameMode == null)
        {
            string      title    = "ERROR";
            string      message  = "Please select a game mode.";
            UnityAction okAction = GameModeNotSelectedOK;

            mainMenuHandler.ShowErrorDialog(title, message, okAction);
        }
        else
        {
            Network.InitializeServer(3, NetworkManager.portNumber, false);
        }
    }