- Home /
This question was
closed Jun 29, 2017 at 03:35 AM by
wolve3000 for the following reason:
Solution found
Question by
wolve3000 · Jun 28, 2017 at 05:11 AM ·
networkingmatch
what is alternative to make Legacy classes in UnityEngine.Networking.Match work?
using UnityEngine; using UnityEngine.Networking; using UnityEngine.Networking.Match; using System.Collections.Generic; using UnityEngine.UI;
public class JoinGame : MonoBehaviour {
private NetworkManager networkManager;
void Start () {
networkManager = NetworkManager.singleton;
if(networkManager.matchMaker == null)
{
networkManager.StartMatchMaker();
}
RefreshRoomList();
}
public void RefreshRoomList()
{
networkManager.matchMaker.ListMatches(0, 20, "", OnMatchList);
status.text = "Loading...";
}
public void OnMatchList (ListMatchResponse matchList)
{
status.text = "";
if(matchList -= null)
{
status.text = "Couldn't get room list";
return;
}
ClearRoomList();
foreach (MatchDesc Match in matchList.matches)
{
GameObject _roomListItemGO = Instantiate(roomListItemPrefab);
_roomListItemGO.transform.SetParent(roomListParent);
//have a component sit on the gameobject that will take care of setting
//up name/amount of users as well as setting up a callback function that
//will join the game.
}
}
Above is the code. ListMatcheResponse and MatchDesc are legacy classes, what is alternative to make these work?
Anyone who knows the solution, please help.
Comment
Follow this Question
Related Questions
UNET Matchmaking Filter Issues 1 Answer
Automatic Match Joining for Networked Games 0 Answers
Unity networking tutorial? 6 Answers
What is the correct way to destroy a UNET Network Match 0 Answers