public void OnDestroy() { if (Instance != null && Instance == this) { if (chatClient != null) { chatClient.Disconnect(); } } }