private async void OnDestroy() { if (firstCheck) { if (alive) { await _chatHub.LeaveAsync(); } await this._chatHub.DisposeAsync(); await this._channel.ShutdownAsync(); } }
public async void JoinOrLeave() { if (isJoin) { await streamingClient.LeaveAsync(); InitializeUi(); } else { var request = new JoinRequest { RoomName = "SampleRoom", UserName = Input.text }; await streamingClient.JoinAsync(request); isJoin = true; SendMessageButton.interactable = true; JoinOrLeaveButtonText.text = "Leave the room"; Input.text = string.Empty; Input.placeholder.GetComponent <Text>().text = "Please enter a comment."; ExceptionButton.interactable = true; } }
public async Task LeaveAsync() => await chatHub.LeaveAsync();
async void IHubClient.LeaveHubAsync() { await _streamingHub.LeaveAsync(); }