void OnGUIReady() { if (isLocalPlayer) { lobbyPlayer.SendReadyToBeginMessage(); } }
public void SendReady() { if (m_CurrentLocalLobbyPlayer) { m_CurrentLocalLobbyPlayer.SendReadyToBeginMessage(); } }
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)); } }
// Update is called once per frame void Update() { if (networkLobbyPlalyer.readyToBegin) { networkLobbyPlalyer.SendReadyToBeginMessage(); this.gameObject.SetActive(false); } }
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(); } } } }
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; */ }
public void ReadyButtonClick() { if (myPlayer != null) { if (!ReadyCheck.isOn) { Debug.Log("Sending ready message!"); myPlayer.SendReadyToBeginMessage(); } else { myPlayer.SendNotReadyToBeginMessage(); } } }
//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; } }
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); }); } } }