Exemplo n.º 1
0
 void OnGUIReady()
 {
     if (isLocalPlayer)
     {
         lobbyPlayer.SendReadyToBeginMessage();
     }
 }
Exemplo n.º 2
0
 public void SendReady()
 {
     if (m_CurrentLocalLobbyPlayer)
     {
         m_CurrentLocalLobbyPlayer.SendReadyToBeginMessage();
     }
 }
Exemplo n.º 3
0
    public void onReady()
    {
        GameObject[] lobbyPlayers = GameObject.FindGameObjectsWithTag("lobbyplayer");

        // May happen during network delays.
        if (lobbyPlayers.Length <= 0)
        {
            Debug.Log("LOBBY_HUD::onReady: No lobby players found!");
            //FindObjectOfType<NetworkPlayerSelect>().GetComponent<NetworkPlayerSelect>().TryToAddPlayer();
        }

        foreach (GameObject player in lobbyPlayers)
        {
            NetworkLobbyPlayer lobbyPlayer = player.GetComponent <NetworkLobbyPlayer>();

            if (!lobbyPlayer.isLocalPlayer)
            {
                continue;
            }

            if (!lobbyPlayer.readyToBegin)
            {
                lobbyPlayer.SendReadyToBeginMessage();
            }
            else
            {
                lobbyPlayer.SendNotReadyToBeginMessage();
            }

            StartCoroutine(this.initLobbyRoom(0.0f));
        }
    }
Exemplo n.º 4
0
 // Update is called once per frame
 void Update()
 {
     if (networkLobbyPlalyer.readyToBegin)
     {
         networkLobbyPlalyer.SendReadyToBeginMessage();
         this.gameObject.SetActive(false);
     }
 }
Exemplo n.º 5
0
 void OnGUIReady()
 {
     if (isLocalPlayer)
     {
         Debug.Log("PlayerLobby::OnGUIReady");
         lobbyPlayer.SendReadyToBeginMessage();
     }
 }
    void Update()
    {
        if (!isLocalPlayer)
        {
            return;
        }

        if (Input.GetButtonDown("Fire1"))
        {
            _lPlayer.SendReadyToBeginMessage();
        }
    }
 public void RpcSetReady()
 {
     if (GameObject.FindGameObjectsWithTag("LobbyPlayer").Length > 0)
     {
         foreach (GameObject netPlayerObj in GameObject.FindGameObjectsWithTag("LobbyPlayer"))
         {
             NetworkLobbyPlayer netPlayer = netPlayerObj.GetComponent <NetworkLobbyPlayer>();
             if (netPlayer.isLocalPlayer)
             {
                 netPlayer.SendReadyToBeginMessage();
             }
         }
     }
 }
Exemplo n.º 8
0
    public void Ready()
    {
        SetUpButton(notReadyButton.GetComponent <_2DContextButton>());
        lobbyPlayer.SendReadyToBeginMessage();
        readyButton.gameObject.SetActive(false);
        notReadyButton.gameObject.SetActive(true);

        /*
         * networkMan.mapButton.gameObject.GetComponent<_2DContextButton>().westNeighbor = notReadyButton.gameObject;
         * networkMan.mapButton.gameObject.GetComponent<_2DContextButton>().eastNeighbor = notReadyButton.gameObject;
         * networkMan.addPlayerButton.GetComponent<_2DContextButton>().northNeighbor = notReadyButton.gameObject;
         * networkMan.addPlayerButton.GetComponent<_2DContextButton>().southNeighbor = notReadyButton.gameObject;
         */
    }
Exemplo n.º 9
0
 public void ReadyButtonClick()
 {
     if (myPlayer != null)
     {
         if (!ReadyCheck.isOn)
         {
             Debug.Log("Sending ready message!");
             myPlayer.SendReadyToBeginMessage();
         }
         else
         {
             myPlayer.SendNotReadyToBeginMessage();
         }
     }
 }
Exemplo n.º 10
0
 //Zmiana stanu gotowośći gracza
 public void Ready()
 {
     if (ready == true)
     {
         LobbyPlayer.SendReadyToBeginMessage();
         LobbyPlayer.gameObject.GetComponent <PlayerLobby>().CmdChangeState(ready);
         ready = false;
     }
     else
     {
         LobbyPlayer.SendNotReadyToBeginMessage();
         LobbyPlayer.gameObject.GetComponent <PlayerLobby>().CmdChangeState(ready);
         ready = true;
     }
 }
Exemplo n.º 11
0
    void Update()
    {
        MainVRMenu.MenuInstance.ClearEachFrame = true;
        ScndVRMenu.MenuInstance.ClearEachFrame = true;

        bool noConnection = (client == null || client.connection == null ||
                             client.connection.connectionId == -1);

        //Debug.Log("NetworkServer.active: " + NetworkServer.active);
        //Debug.Log("IsClientConnected(): " + IsClientConnected());
        //Debug.Log("noConnection: " + noConnection);

        if (!NetworkServer.active && !IsClientConnected() && noConnection)
        {
            if (matchMaker != null)
            {
                if (matchInfo == null)
                {
                    if (matches == null)
                    {
                        MainVRMenu.MenuInstance.RegisterButton("Create Internet Match", () =>
                        {
                            Debug.Log("Create Internet Match");
                            //matchMaker.CreateMatch(matchName, matchSize, true, "", OnMatchCreate);
                            return(false);
                        });
                        MainVRMenu.MenuInstance.RegisterButton("Find Internet Match", () =>
                        {
                            Debug.Log("Find Internet Match");
                            //matchMaker.ListMatches(0, 20, "", OnMatchList);
                            return(false);
                        });
                    }
                    if (matches != null)
                    {
                        if (LastMathCount != matches.Count)
                        {
                            foreach (var match in matches)
                            {
                                MainVRMenu.MenuInstance.RegisterButton(match.name, () =>
                                {
                                    matchName = match.name;
                                    matchSize = (uint)match.currentSize;
                                    //matchMaker.JoinMatch(match.networkId, "", OnMatchJoined);
                                    return(true);
                                });
                            }
                        }

                        LastMathCount = matches.Count;
                    }
                }

                MainVRMenu.MenuInstance.RegisterButton("Restart Match Making", () =>
                {
                    Debug.Log("Restart Match Making");
                    StopMatchMaker();
                    StartMatchMaker();
                    return(false);
                });
            }
        }
        else
        {
            if (MatchInfo != null)
            {
                MatchInfo.text = matchName;
            }

            LobbyPlayer = FindObjectOfType <NetworkLobbyPlayer>();
            if (LobbyPlayer != null)
            {
                MainVRMenu.MenuInstance.RegisterButton("Ready", () =>
                {
                    LobbyPlayer.SendReadyToBeginMessage();
                    return(false);
                });
                MainVRMenu.MenuInstance.RegisterButton("Unready", () =>
                {
                    LobbyPlayer.SendNotReadyToBeginMessage();
                    return(false);
                });
            }
        }
    }