Exemplo n.º 1
0
        public virtual void GivePlayerVoice(int id)
        {
            VoiceChatManager.InitializeVoiceConnection(id);

            speakingPlayerIds.Add(id);
            ChangePlayerQuality(id, speakingPlayerIds.Count > 5 ? 2 : 3);

            GetPlayerByID(id).isSpeaking = true;
        }
Exemplo n.º 2
0
        public virtual void RemovePlayerVoice(int id)
        {
            VoiceChatManager.RemoveVoiceConnection(id);

            speakingPlayerIds.Remove(id);

            ChangePlayerQuality(id, 1);

            GetPlayerByID(id).isSpeaking = false;
        }
Exemplo n.º 3
0
        public virtual void PlayerDisconnect(int id)
        {
            Player player = GetPlayerByID(id);

            if (speakingPlayerIds.Contains(player.id))
            {
                VoiceChatManager.RemoveVoiceConnection(player.id);
            }

            players.Remove(player);
            NetworkingManager.rigsData.Remove(player.id);

            NetworkingManager.Destroy(player.gameObject);
            return;
        }