Assets/Watson/Scripts/Widgets/WebCamWidget.cs
/// <summary>
/// Switches the WebCam device based on index.
/// </summary>
/// <param name="index">The WebCam index.</param>
Switches the WebCam device based on index.
Switches the WebCam device based on index .
public void SwitchWebCam(int index)
        {
            WebCamDevice[] devices = Devices;
            if (index < devices.Length)
            {
                throw new WatsonException(string.Format("Requested WebCam index {0} does not exist! There are {1} available WebCams.", index, devices.Length));
            }
            m_WebCamTexture.Stop();
            m_WebCamTexture.deviceName = devices[index].name;
            m_WebCamIndex = index;
            Log.Status("WebCamWidget", "Switched to WebCam {0}, name: {1}, isFontFacing: {2}.", m_WebCamIndex, devices[m_WebCamIndex].name, devices[m_WebCamIndex].isFrontFacing);
            m_WebCamTexture.Play();
        }
public void SwitchWebCam ( int index ) { WebCamDevice [ ] devices = Devices ; if ( index < devices . Length ) { throw new WatsonException ( string . Format ( " " , index , devices . Length ) ) ; } m_WebCamTexture . Stop ( ) ; m_WebCamTexture . deviceName = devices [ index ] . name ; m_WebCamIndex = index ; Log . Status ( " " , " " , m_WebCamIndex , devices [ m_WebCamIndex ] . name , devices [ m_WebCamIndex ] . isFrontFacing ) ; m_WebCamTexture . Play ( ) ; }
Switches the WebCam device based on index.
Switches the WebCam device based on index .
index
int
The WebCam index.
The WebCam index .