private void ShowInternetMatchData(Match.MatchInfoSnapshot match) { GameObject joinButtonObject = Instantiate(JoinGameButtonObject, new Vector3(-100, 100, 0), Quaternion.identity, MatchInfoListPanel.transform); joinButtonObject.GetComponent <Button>().onClick.AddListener(delegate { JoinInternetMatch(match); }); matchNameText.GetComponent <Text>().text = match.name; playerCountText.GetComponent <Text>().text = "# of Players: " + match.currentSize; }
/// <summary> /// Sets the match stored if none is present /// </summary> /// <param name="m">The match to set</param> public void SetMatch(UnityEngine.Networking.Match.MatchInfoSnapshot m) { if (Match == null) { Match = m; GetComponent <Button>().onClick.AddListener(SetMatchInfo); } }
private void JoinInternetMatch(Match.MatchInfoSnapshot match) { manager.matchName = match.name; manager.matchSize = (uint)match.currentSize; manager.matchMaker.JoinMatch(match.networkId, "", "", "", 0, 0, manager.OnMatchJoined); MatchMakerPanel.SetActive(false); MatchesPanel.SetActive(false); Title.SetActive(false); ConnectedNetworkPanel.SetActive(true); }
public MatchInfoObject(MatchInfoSnapshot snapshot) #endif { this.networkId = snapshot.networkId; this.hostNodeId = snapshot.hostNodeId; this.name = snapshot.name; this.averageEloScore = snapshot.averageEloScore; this.maxSize = snapshot.maxSize; this.currentSize = snapshot.currentSize; this.isPrivate = snapshot.isPrivate; this.matchAttributes = snapshot.matchAttributes; this.directConnectInfos = snapshot.directConnectInfos; }
/// <summary> /// Display matches over time /// </summary> /// <returns>The routine of getting matches</returns> private IEnumerator CorShowMatches() { while (matchButtons.Count > 0) { DestroyMatchButton(matchButtons[0]); } yield return(manager.matchMaker.ListMatches(0, 20, "", false, 0, 0, manager.OnMatchList)); if (manager.matches != null) { foreach (UnityEngine.Networking.Match.MatchInfoSnapshot m in manager.matches) { currentMatch = m; MakeMatchButton(); } } }
void CUnirSala(UnityEngine.Networking.Match.MatchInfoSnapshot _sala) { print("Unir a sala"); matchMaker.JoinMatch(_sala.networkId, "", "", "", 0, 0, OnMatchJoined); }
public void JoinGame(Match.MatchInfoSnapshot match) { manager.matchName = match.name; manager.matchMaker.JoinMatch(match.networkId, "", "", "", 0, 0, manager.OnMatchJoined); }