/// <summary>Called by UI.</summary> public void JoinOrCreateRoom(string roomname) { roomname = roomname.Trim(); ConnectAndJoin caj = this.GetComponent <ConnectAndJoin>(); if (caj == null) { return; } //Debug.LogFormat("JoinOrCreateRoom() roomname: {0}", roomname); if (string.IsNullOrEmpty(roomname)) { caj.RoomName = string.Empty; caj.RandomRoom = true; //caj.HideRoom = false; } else { caj.RoomName = roomname; caj.RandomRoom = false; //caj.HideRoom = true; } this.voiceConnection.Client.OpLeaveRoom(false); }
// ------------------------------------------- /* * StartVoiceStreaming */ public void StartVoiceStreaming(bool _emitVoice) { object voiceFoun = Resources.Load("Voice/Voice Connection and Recorder"); bool voiceHasBeenFound = false; if (voiceFoun != null) { GameObject voicePrefab = voiceFoun as GameObject; if (voicePrefab != null) { voiceHasBeenFound = true; m_voiceGO = GameObject.Instantiate(voicePrefab); ConnectAndJoin joinVoice = m_voiceGO.transform.GetComponentInChildren <ConnectAndJoin>(); m_voiceConnection = GameObject.FindObjectOfType <VoiceConnection>(); m_voiceConnection.SpeakerLinked += this.OnSpeakerCreated; if ((joinVoice != null) && (m_voiceConnection != null)) { joinVoice.RoomName = PhotonNetwork.CurrentRoom.Name; m_voiceConnection.PrimaryRecorder.TransmitEnabled = _emitVoice; joinVoice.ConnectNow(); NetworkEventController.Instance.DispatchLocalEvent(EVENT_PHOTONCONTROLLER_VOICE_CREATED, m_voiceConnection.gameObject.transform); } } } if (!voiceHasBeenFound) { Debug.LogError("StartVoiceStreaming::PREFAB VOICE NOT FOUND!!!!!!!!!!!!!!!!"); } }
private void OnEnable() { connectAndJoin = target as ConnectAndJoin; randomRoomSp = serializedObject.FindProperty("RandomRoom"); roomNameSp = serializedObject.FindProperty("RoomName"); autoConnectSp = serializedObject.FindProperty("autoConnect"); autoTransmitSp = serializedObject.FindProperty("autoTransmit"); }
private void OnEnable() { this.connectAndJoin = this.target as ConnectAndJoin; this.randomRoomSp = this.serializedObject.FindProperty("RandomRoom"); this.roomNameSp = this.serializedObject.FindProperty("RoomName"); this.autoConnectSp = this.serializedObject.FindProperty("autoConnect"); this.autoTransmitSp = this.serializedObject.FindProperty("autoTransmit"); }
private void Awake() { Screen.SetResolution(this.screenWidth, this.screenHeight, this.fullScreen); this.connectAndJoin = this.GetComponent <ConnectAndJoin>(); this.voiceConnection = this.GetComponent <VoiceConnection>(); this.voiceAudioPreprocessor = this.voiceConnection.PrimaryRecorder.GetComponent <WebRtcAudioDsp>(); this.compressionGainGameObject = this.agcCompressionGainSlider.transform.parent.gameObject; this.compressionGainText = this.compressionGainGameObject.GetComponentInChildren <Text>(); this.aecOptionsGameObject = this.aecHighPassToggle.transform.parent.gameObject; this.SetDefaults(); this.InitUiCallbacks(); this.InitUiValues(); this.GetSavedNickname(); }