public GameSequence(User usr, InputField fld, gameList gameList) { user = usr; inputRoom = fld; this.gameList = gameList; SetupClient(); }
private void handlePacket(string message) { codePacket data = (codePacket)JsonUtility.FromJson(message, typeof(codePacket)); if (data.code == 200) { startServer = true; } if (data.code == 1000) { gameList games = JsonUtility.FromJson <gameList>(message); Debug.Log(JsonUtility.ToJson(games)); int j; currentGames = games.games; /* * for( j = 0; j < games.games.Count; j++) { * Debug.Log(games.games[j].game_name); * } */ } if (data.code == 301) { gameInfo _data = (gameInfo)JsonUtility.FromJson(message, typeof(gameInfo)); connectToPort = _data.game_port; shouldConnect = true; } }
void Awake() { mainCamera = GameObject.Find("Main Camera"); gameList = gameList.GetComponent <gameList>(); User user = new User(); seq = new GameSequence(user, inputRoom, gameList); }