void Start() { this.client = GameObject.FindGameObjectWithTag("Communication").GetComponent <ReaLabCommunication>(); this.client.Connect(); this.client.onPause += Client_onPause; this.client.onNewConfiguration += Client_onNewConfiguration; this.client.onStop += Client_onStop; }
private void Client_onStop(object obj, EventArgs stopArgs) { this.client.Disconnect(); this.client.onPause -= Client_onPause; this.client.onNewConfiguration -= Client_onNewConfiguration; this.client = null; this.canGameStop = true; }
void OnApplicationQuit() { Debug.Log("Quit"); if (this.client != null) { Debug.Log("Disco Quit"); this.client.Disconnect(); this.client.onPause -= Client_onPause; this.client.onNewConfiguration -= Client_onNewConfiguration; this.client = null; } }