private void ShowHazards(int connId, int channelId, int recHostId, Message_Spawn message) { var gameControllerObj = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController>(); StringBuilder s = new StringBuilder(); s.Append("["); for (int i = 0; i < gameControllerObj.hazards.Count; i++) { s.Append(JsonUtility.ToJson(gameControllerObj.hazards[i])); if (i < gameControllerObj.hazards.Count - 1) { s.Append(","); } } s.Append("]"); var messageHazard = new Message_Hazards { hazards = s.ToString() }; SendClient(recHostId, connId, messageHazard); }
private void SpawnPlayer(int connId, int channelId, int recHostId, Message_Spawn message) { //Debug.Log(string.Format("Player {2} position is X: {0}, Y: {1}", message.X, message.Y, connId)); }