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(); }
private WebSocketIO() { events = new Dictionary <string, WebSocketEvent>(); behaviour = WebSocketBehaviour.Instance; }