Ejemplo n.º 1
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else if (instance != this)
     {
         Debug.LogError($"Two or more instance of '{nameof(WebSocketBehaviour)}' has been found. The new one will be destroyed.");
         Destroy(this);
     }
     Initialize();
 }
Ejemplo n.º 2
0
 private WebSocketIO()
 {
     events    = new Dictionary <string, WebSocketEvent>();
     behaviour = WebSocketBehaviour.Instance;
 }