My Connect Manager code does not generate itself when I get any export. It works in Unity Editor but my code does not work when I get any export. My code is as follows;
using System;
using System.Collections;
using System.Collections.Generic;
using Newtonsoft.Json;
using UnityEngine;
using SocketIOClient;
using UnityEngine.SceneManagement;
using SocketIOClient.Newtonsoft.Json;
using Random = UnityEngine.Random;
public class ConnectManager : MonoBehaviour
{
public static ConnectManager Instance;
public SocketIOUnity socket;
public GameObject loadingPanel;
private string idGoogle;
private void Awake()
{
if (!Instance)
{
Instance = this;
DontDestroyOnLoad(this);
}
else
{
Destroy(gameObject);
}
ConnectSocket();
}
public void ConnectSocket()
{
var uri = new Uri("myserver");
socket = new SocketIOUnity(uri, new SocketIOOptions
{
Query = new Dictionary<string, string>
{
{"token", "UNITY"}
},
EIO = 4,
Transport = SocketIOClient.Transport.TransportProtocol.WebSocket
});
socket.OnConnected += (sender, e) => { Debug.LogError(e.ToString()); };
socket.OnError += (sender, e) => { Debug.LogError(e.ToString()); };
socket.OnDisconnected += (sender, e) => { Debug.LogError(e.ToString()); };
socket.Connect();
Debug.LogError("adad "+ socket.Connected);
socket.JsonSerializer = new NewtonsoftJsonSerializer();
}
}
Everything works as it should in the Editor. I don't get any error log. Only my object is not set at start. In Android build etc (i test with logcat dont have any error) object is always null)
My Connect Manager code does not generate itself when I get any export. It works in Unity Editor but my code does not work when I get any export. My code is as follows;
Everything works as it should in the Editor. I don't get any error log. Only my object is not set at start. In Android build etc (i test with logcat dont have any error) object is always null)