Beispiel #1
0
 private void SetCurrentValue()
 {
     if (this.micOptions == null)
     {
         Debug.LogWarning("micOptions list is null");
         return;
     }
     for (int valueIndex = 0; valueIndex < this.micOptions.Count; valueIndex++)
     {
         MicRef val = this.micOptions[valueIndex];
         if (this.recorder.MicrophoneType == val.MicType)
         {
             if (this.recorder.MicrophoneType == Recorder.MicType.Unity &&
                 val.Name.Equals(this.recorder.UnityMicrophoneDevice))
             {
                 this.micDropdown.value = valueIndex;
                 break;
             }
             if (this.recorder.MicrophoneType == Recorder.MicType.Photon &&
                 val.PhotonId == this.recorder.PhotonMicrophoneDeviceId)
             {
                 this.micDropdown.value = valueIndex;
                 break;
             }
         }
     }
 }
Beispiel #2
0
        private void MicDropdownValueChanged(MicRef mic)
        {
            this.recorder.MicrophoneType = mic.MicType;

            switch (mic.MicType)
            {
            case Recorder.MicType.Unity:
                this.recorder.UnityMicrophoneDevice = mic.Name;
                break;

            case Recorder.MicType.Photon:
                this.recorder.PhotonMicrophoneDeviceId = mic.PhotonId;
                break;
            }

            if (this.recorder.RequiresRestart)
            {
                this.recorder.RestartRecording();
            }
        }
        void MicDropdownValueChanged(MicRef mic)
        {
            this.recorder.MicrophoneType = mic.type;

            switch (mic.type)
            {
            case Recorder.MicType.Unity:
                this.recorder.UnityMicrophoneDevice = mic.name;
                break;

            case Recorder.MicType.Photon:
                this.recorder.PhotonMicrophoneDeviceId = mic.id;
                break;
            }

            if (this.recorder.IsInitialized && this.recorder.RequiresInit)
            {
                this.recorder.ReInit();
            }
        }
        private void SetCurrentValue()
        {
            int valueIndex = 0;

            for (; valueIndex < this.micOptions.Count; valueIndex++)
            {
                MicRef val = this.micOptions[valueIndex];
                if (this.recorder.MicrophoneType == val.MicType)
                {
                    if (this.recorder.MicrophoneType == Recorder.MicType.Unity &&
                        val.Name.Equals(this.recorder.UnityMicrophoneDevice))
                    {
                        this.micDropdown.value = valueIndex;
                        break;
                    }
                    if (this.recorder.MicrophoneType == Recorder.MicType.Photon &&
                        val.PhotonId == this.recorder.PhotonMicrophoneDeviceId)
                    {
                        this.micDropdown.value = valueIndex;
                        break;
                    }
                }
            }
        }
 private void SetCurrentValue()
 {
     if (this.micOptions == null)
     {
         Debug.LogWarning("micOptions list is null");
         return;
     }
     #if PHOTON_MICROPHONE_ENUMERATOR
     bool photonMicEnumAvailable = Recorder.PhotonMicrophoneEnumerator.IsSupported;
     #else
     bool photonMicEnumAvailable = false;
     #endif
     this.photonToggle.onValueChanged.RemoveAllListeners();
     this.photonToggle.isOn = this.recorder.MicrophoneType == Recorder.MicType.Photon;
     if (!photonMicEnumAvailable)
     {
         this.photonToggle.onValueChanged.AddListener(this.PhotonMicToggled);
     }
     this.micDropdown.gameObject.SetActive(photonMicEnumAvailable || this.recorder.MicrophoneType == Recorder.MicType.Unity);
     this.toggleButton.SetActive(!photonMicEnumAvailable);
     this.refreshButton.SetActive(photonMicEnumAvailable || this.recorder.MicrophoneType == Recorder.MicType.Unity);
     for (int valueIndex = 0; valueIndex < this.micOptions.Count; valueIndex++)
     {
         MicRef val = this.micOptions[valueIndex];
         if (this.recorder.MicrophoneType == val.MicType)
         {
             if (this.recorder.MicrophoneType == Recorder.MicType.Unity &&
                 Recorder.CompareUnityMicNames(val.Name, this.recorder.UnityMicrophoneDevice))
             {
                 this.micDropdown.value = valueIndex;
                 return;
             }
             if (this.recorder.MicrophoneType == Recorder.MicType.Photon &&
                 val.PhotonId == this.recorder.PhotonMicrophoneDeviceId)
             {
                 this.micDropdown.value = valueIndex;
                 return;
             }
         }
     }
     for (int valueIndex = 0; valueIndex < this.micOptions.Count; valueIndex++)
     {
         MicRef val = this.micOptions[valueIndex];
         if (this.recorder.MicrophoneType == val.MicType)
         {
             if (this.recorder.MicrophoneType == Recorder.MicType.Unity)
             {
                 this.micDropdown.value = valueIndex;
                 this.recorder.UnityMicrophoneDevice = val.Name;
                 break;
             }
             if (this.recorder.MicrophoneType == Recorder.MicType.Photon)
             {
                 this.micDropdown.value = valueIndex;
                 this.recorder.PhotonMicrophoneDeviceId = val.PhotonId;
                 break;
             }
         }
     }
     if (this.recorder.RequiresRestart)
     {
         this.recorder.RestartRecording();
     }
 }