Пример #1
0
        /// <summary>
        /// Returns a VoiceChat object with the channel name.  Use this to start a voice chat with other players.
        /// All players can talk to each other if using the same channel name.
        /// Or you can have the red team join one channel while the blue team join another channel, and have an "all" channel
        /// for all players to talk to all others.
        /// </summary>
        /// <returns>The voice chat.</returns>
        /// <param name="channel">Channel name.</param>
        public VoiceChat GetVoiceChat(string channel)
        {
            RealTimeMatchesController.EnableVoiceChat();

            // return if already created
            if (_voiceChats == null)
            {
                _voiceChats = new Dictionary <string, VoiceChat>();
            }

            VoiceChat chat = null;

            if (_voiceChats.TryGetValue(channel, out chat))
            {
                return(chat);
            }

            // get it and create a wrapper
            var gkchat = gkMatch.VoiceChat(channel);

            if (gkchat != null)
            {
                chat = NSObjectWrapper.CreateWrapper(typeof(VoiceChat), gkchat) as VoiceChat;
                _voiceChats[channel] = chat;
            }

            return(chat);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="U3DXT.iOS.GameKit.VoiceChatPlayerStateChangedEventArgs"/> class.
 /// </summary>
 /// <param name="voiceChat">Voice Chat.</param>
 /// <param name="player">Player.</param>
 /// <param name="state">State.</param>
 public VoiceChatPlayerStateChangedEventArgs(VoiceChat voiceChat, Player player, GKVoiceChatPlayerState state)
 {
     this.voiceChat = voiceChat;
     this.player = player;
     this.state = state;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="U3DXT.iOS.GameKit.VoiceChatPlayerStateChangedEventArgs"/> class.
 /// </summary>
 /// <param name="voiceChat">Voice Chat.</param>
 /// <param name="player">Player.</param>
 /// <param name="state">State.</param>
 public VoiceChatPlayerStateChangedEventArgs(VoiceChat voiceChat, Player player, GKVoiceChatPlayerState state)
 {
     this.voiceChat = voiceChat;
     this.player    = player;
     this.state     = state;
 }