Exemplo n.º 1
0
    /// <summary>
    /// Gets nickname or asks for new one
    /// </summary>
    void Start()
    {
        networkManager   = OxyniteNetworkManager.GetInstance();
        networkDiscovery = OxyniteNetworkDiscovery.GetInstance();

        networkManager.StartMatchMaker();
        RefreshRoomList();

        if (PlayerPrefs.HasKey("nickname"))
        {
            nicknamePanel.gameObject.SetActive(false);
            nicknameText.text = PlayerPrefs.GetString("nickname");
        }
        else
        {
            nicknamePanel.gameObject.SetActive(true);
        }
    }
Exemplo n.º 2
0
 /// <summary>
 /// Create internet match
 /// </summary>
 public void HostInternetGame()
 {
     networkManager.StartMatchMaker();
     networkManager.matchMaker.CreateMatch(roomNameText.text, 16, true, "", "", "", 0, 0, networkManager.OnMatchCreate);
     networkDiscovery.StopListening();
 }