You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using System.Collections.Generic;
using SocketIOClient;
using SocketIOClient.Newtonsoft.Json;
using UnityEngine;
using UnityEngine.UI;
using Newtonsoft.Json.Linq;
using UnityEngine.SceneManagement;
public class ClientSocketManager : MonoBehaviour
{
public SocketIOUnity socket;
public Text ReceivedText;
public Image t;
// Start is called before the first frame update
void Start()
{
//TODO: check the Uri if Valid.
var uri = new Uri("http://localhost:3000");
socket = new SocketIOUnity(uri, new SocketIOOptions
{
Query = new Dictionary<string, string>
{
{"token", "UNITY" }
}
,
EIO = 4
,
Transport = SocketIOClient.Transport.TransportProtocol.WebSocket
});
socket.JsonSerializer = new NewtonsoftJsonSerializer();
///// reserved socketio events
socket.OnConnected += (sender, e) =>
{
Debug.Log("connected");
SceneManager.LoadScene("GameScene");
};
socket.Connect();
}
}
this is my code. very simple, LoadScene does not work even do the callback is called ( debug.log connected works )
The text was updated successfully, but these errors were encountered:
using System.Collections.Generic;
using SocketIOClient;
using SocketIOClient.Newtonsoft.Json;
using UnityEngine;
using UnityEngine.UI;
using Newtonsoft.Json.Linq;
using UnityEngine.SceneManagement;
public class ClientSocketManager : MonoBehaviour
{
public SocketIOUnity socket;
}
this is my code. very simple, LoadScene does not work even do the callback is called ( debug.log connected works )
The text was updated successfully, but these errors were encountered: