Beispiel #1
0
    public void CreateRoomButtonClicked(InputField roomName)
    {
        if (roomName.text.Length == 0)
        {
            return;
        }

        TitleUIManager.PlayButtonSound();

        NetworkWrapper.StartServer(roomName.text);
        NavigateToRoomSessionMenu(roomName.text);
    }
Beispiel #2
0
    public void BackButtonClicked()
    {
        TitleUIManager.PlayButtonSound();
        if (NetworkWrapper.discovery.isServer)
        {
            NetworkWrapper.discovery.StopBroadcast();
            NetworkWrapper.manager.StopHost();

            //TODO: kick players back to the first menu

            TitleUIManager.Navigate_HostJoinRoomMenu();
        }
        else
        {
            StartCoroutine(ClientLeave());
        }
    }
    public void CreateRoomButtonClicked(InputField roomName)
    {
        if (roomName.text.Length == 0)
        {
            return;
        }

        if (roomName.text.All(x => char.IsNumber(x) || x == '.'))
        {
            NetworkWrapper.ConnectToServer(roomName.text);
            NavigateToRoomSessionMenu(roomName.text);
            return;
        }

        TitleUIManager.PlayButtonSound();

        NetworkWrapper.StartServer(roomName.text);
        NavigateToRoomSessionMenu(roomName.text);
    }
Beispiel #4
0
    public void ClassCycleRightButtonClicked()
    {
        TitleUIManager.PlayButtonSound();

        //dont change characters if we're readied up
        if (PersistentPlayer.localAuthority.isReady)
        {
            return;
        }

        if (characterIndex == (characters.Count - 1))
        {
            characterIndex = 0;
        }
        else
        {
            characterIndex++;
        }

        UpdateCharacterPanel();
    }
Beispiel #5
0
    /// <summary>
    /// Button click method (set in the inspector) for buttons on the list of rooms
    /// </summary>
    /// <param name="buttonClicked"></param>
    public void RoomSelected(GameObject buttonClicked)
    {
        TitleUIManager.PlayButtonSound();
        Text t = buttonClicked.GetComponentInChildren <Text>();

        if (t != null)
        {
            string ipAddress = NetworkWrapper.discovery.GetAddressOfRoom(t.text);
            if (ipAddress != null)
            {
                NetworkWrapper.ConnectToServer(ipAddress);
                NavigateToRoomSessionMenu(t.text);
            }
            else
            {
                Debug.LogErrorFormat("No room of name {0}", t.text);
            }
        }
        else
        {
            Debug.LogError("Cannot get name of room selected.");
        }
    }
Beispiel #6
0
 public void ReadyButtonClicked()
 {
     TitleUIManager.PlayButtonSound();
     PersistentPlayer.localAuthority.isReady = !PersistentPlayer.localAuthority.isReady;
     PersistentPlayer.localAuthority.CmdUpdatePanel(characterIndex, PersistentPlayer.localAuthority.isReady);
 }