示例#1
0
    private async void OnDestroy()
    {
        if (firstCheck)
        {
            if (alive)
            {
                await _chatHub.LeaveAsync();
            }
            await this._chatHub.DisposeAsync();

            await this._channel.ShutdownAsync();
        }
    }
示例#2
0
        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;
            }
        }
示例#3
0
 public async Task LeaveAsync() => await chatHub.LeaveAsync();
 async void IHubClient.LeaveHubAsync()
 {
     await _streamingHub.LeaveAsync();
 }