Ejemplo n.º 1
0
    async void OnDestroy()
    {
        if (gameHub != null)
        {
            Debug.Log($"Destroy {channel.Target}");
            await gameHub.LeaveAsync();

            await gameHub.DisposeAsync();

            if (players.Count == 0)
            {
                await channel.ShutdownAsync();
            }
        }
    }
Ejemplo n.º 2
0
    public async void JoinOrLeave()
    {
        if (isJoin)
        {
            await _gameHub.LeaveAsync();

            isJoin = false;
        }
        else
        {
            await _gameHub.JoinAsync();

            this.isJoin = true;
        }
    }
Ejemplo n.º 3
0
 async void IHubClient.LeaveHubAsync()
 {
     await _streamingHub.LeaveAsync();
 }