/// <summary>Called by Unity when the application is closed. Disconnects.</summary> protected virtual void OnApplicationQuit() { //Debug.Log("OnApplicationQuit"); this.StopFallbackSendAckThread(); if (this.Client != null) { this.Client.Disconnect(); } SupportClass.StopAllBackgroundCalls(); }
/// <summary>Called by Unity when the application gets closed. Disconnects if OnApplicationQuit() was called before.</summary> protected virtual void OnDisable() { this.StopFallbackSendAckThread(); if (AppQuits) { if (this.Client != null && this.Client.IsConnected) { this.Client.Disconnect(); this.Client.LoadBalancingPeer.StopThread(); } SupportClass.StopAllBackgroundCalls(); } }