Esempio n. 1
0
    //m_msgOutBuffer needs to be set to null on broadcast stop
    public void endBroadcast()
    {
        //StopClient();
        playerInput.SetActive(true);
        LoadCanvas.SetActive(true);
        serverInput.SetActive(true);
        serverB.SetActive(true);
        clientB.SetActive(true);
        endB.SetActive(true);
        LobbyCanvas.SetActive(true);
        StartCanvas.SetActive(true);
        //StopBroadcast();
        try
        {
            Debug.Log("stophost");
            NetworkLobbyManager.singleton.StopHost();
        }
        catch
        {
            Debug.Log("No Server In Lobby");
        }

        try
        {
            Debug.Log("stop client");
            NetworkLobbyManager.singleton.StopClient();
        }
        catch
        {
            Debug.Log("No Client In Lobby");
        }


        SceneManager.LoadScene("offline");
    }
Esempio n. 2
0
 public void startServer()
 {
     //gamename:playername:numon server:
     if (serverNameInput.text.Length < 1 || playerNameInput.text.Length < 1 || serverNameInput.text.Contains(":") || playerNameInput.text.Contains(":"))
     {
         Debug.Log("Server and Player Name must be filled and can't contain the symbol ':'");
     }
     else
     {
         playerInput.SetActive(false);
         serverInput.SetActive(false);
         serverB.SetActive(false);
         clientB.SetActive(false);
         endB.SetActive(true);
         LoadCanvas.SetActive(false);
         LobbyCanvas.SetActive(true);
         StartCanvas.SetActive(false);
         Initialize();
         broadcastData = serverNameInput.text + ":" + playerNameInput.text + ":" + 0;
         StartAsServer();
         NetworkLobbyManager.singleton.matchName = serverNameInput.text;
         netmanager.playerName = playerNameInput.text;
         NetworkLobbyManager.singleton.StartHost();
     }
 }
Esempio n. 3
0
 public void startClient()
 {
     StopAllCoroutines();
     StartCoroutine(CleanUp());
     StartCanvas.SetActive(true);
     LoadCanvas.SetActive(false);
     LobbyCanvas.SetActive(false);
     playerInput.SetActive(false);
     serverInput.SetActive(false);
     serverB.SetActive(false);
     clientB.SetActive(false);
     endB.SetActive(true);
     Initialize();
     netmanager.playerName = playerNameInput.text;
     StartAsClient();
 }
 public SlowCar(StartCanvas canvas)
 {
     _canvas = canvas;
 }
Esempio n. 5
0
 public void Jeu()
 {
     Canvas.SetActive(true);
     Player.SetActive(true);
     StartCanvas.SetActive(false);
 }