void Awake()
        {
            _instance = this;

            _gameHubClient = new GameHubClient(this);
            _gameHubClient.AfterJoinHub   += () => AfterJoinGameHub?.Invoke();
            _gameHubClient.BeforeLeaveHub += () => BeforeLeaveGameHub?.Invoke();
            _gameHubClient.AfterLeaveHub  += () => AfterLeaveGameHub?.Invoke();

            MagicOnionNetwork.RegisterHubClient(_gameHubClient);
        }
Exemple #2
0
        void Awake()
        {
            _instance        = this;
            _remoteVoices    = new Dictionary <int, Speaker>();
            _unityMainThread = SynchronizationContext.Current;

            _voiceChatHubClient = new VoiceChatHubClient(this);
            _voiceChatHubClient.AfterLeaveHub += AfterLeaveVoiceChatHub;

            MagicOnionNetwork.RegisterHubClient(_voiceChatHubClient);
        }
        void Awake()
        {
            _instance = this;

            _chatHubClient = new ChatHubClient(this);
            _chatHubClient.AfterJoinHub   += AfterJoinChatHub;
            _chatHubClient.BeforeLeaveHub += BeforeLeaveChatHub;

            MagicOnionNetwork.RegisterHubClient(_chatHubClient);

            _messageList = new FixedSizeQueue <ChatMessage>(20);
        }