/// <summary>
    /// open the camera
    /// </summary>
    public void Play()
    {
        if (isRunning)
        {
            return;
        }
#if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR
        if (isUseEasyWebCam)
        {
            EasyWebCam.Play();
        }
        else
        {
            if (webcamera != null)
            {
                webcamera.Play();
            }
            else
            {
                webcamera = new WebCamTexture(previewWidth, previewHeight);
                webcamera.Play();
            }
        }
#else
        webcamera.Play();
#endif
        isRunning = true;
    }
Exemple #2
0
    /// <summary>
    /// open the camera
    /// </summary>
    public void Play()
    {
        if (isRunning)
        {
            return;
        }
#if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR
		if(isUseEasyWebCam)
		{
			EasyWebCam.Play();
		}
		else{
			webcamera.Play ();
		}
#else
        webcamera.Play();
#endif
        isRunning = true;
    }
Exemple #3
0
    /// <summary>
    /// open the camera
    /// </summary>
    public void Play()
    {
        if (isRunning)
        {
            return;
        }
#if UNITY_ANDROID && !UNITY_EDITOR
        if (isUseEasyWebCam)
        {
            EasyWebCam.Play();
        }
        else
        {
            webcamera.Play();
        }
#else
        if (UnityEngine.WebCamTexture.devices.Length > 0)
        {
            webcamera.Play();
        }
#endif
        isRunning = true;
    }