/// <summary> /// allows the player to change the voice mode of themselves. /// </summary> void ToggleVoiceMode() { foreach (GameObject gam in GameObject.FindGameObjectsWithTag("Voice")) { if (gam.GetComponent <PlayerPrefabVoiceControlScript>().locview.owner == PhotonNetwork.player) { locplayer = gam.GetComponent <PlayerPrefabVoiceControlScript>(); } } PlayerPrefabVoiceControlScript.VoiceChannel nextchannel = PlayerPrefabVoiceControlScript.VoiceChannel.TeamOnly; if (locplayer.curchannel == PlayerPrefabVoiceControlScript.VoiceChannel.All) { nextchannel = PlayerPrefabVoiceControlScript.VoiceChannel.TeamOnly; } if (locplayer.curchannel == PlayerPrefabVoiceControlScript.VoiceChannel.TeamOnly) { nextchannel = PlayerPrefabVoiceControlScript.VoiceChannel.Muteall; } if (locplayer.curchannel == PlayerPrefabVoiceControlScript.VoiceChannel.Muteall) { nextchannel = PlayerPrefabVoiceControlScript.VoiceChannel.All; } locplayer.setchannelforall(nextchannel); Updatelocplayer(); }
/// <summary> /// Gets the voice channel of a player. /// </summary> /// <param name="input"></param> /// <returns></returns> string getvoicechanneltext(PlayerPrefabVoiceControlScript.VoiceChannel input) { if (input == PlayerPrefabVoiceControlScript.VoiceChannel.All) { return("all"); } else if (input == PlayerPrefabVoiceControlScript.VoiceChannel.TeamOnly) { return("Team Only"); } else { return("Mute all"); } }