// Use this for initialization protected virtual void Awake() { _HUD = FindObjectOfType <HUDManager>(); _client = new TAPNet(HostIp, HostPort) { onResponseReceived = OnServerResponse }; }
// Use this for initialization protected override void Awake() { base.Awake(); _client = new TAPNet(HostIp, HostPort) { onResponseReceived = OnServerResponse }; _otherPlayers = new Dictionary <int, OtherPlayer>(); var initialData = new InitialData { playerName = PlayerPrefs.GetString("playerName") }; _client.Send(initialData.ToJson(), TAPNet.DATAGRAM_RELIABLE); }