예제 #1
0
    public void Stop()
    {
        #if UNITY_ANDROID && !UNITY_EDITOR
        if (EasyWebCam.isActive)
        {
            if (isTorchOn)
            {
                torchImage.sprite = torchOffSprite;
                EasyWebCam.setTorchMode(TBEasyWebCam.Setting.TorchMode.Off);
                isTorchOn = !isTorchOn;
            }
        }
        #endif
        if (this.e_qrController != null)
        {
            this.e_qrController.StopWork();
        }

        if (this.resetBtn != null)
        {
            this.resetBtn.SetActive(false);
        }
        if (this.scanLineObj != null)
        {
            this.scanLineObj.SetActive(false);
        }
    }
예제 #2
0
    public void TorchOff()
    {
#if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR
        if (EasyWebCam.isActive)
        {
            EasyWebCam.setTorchMode(TBEasyWebCam.Setting.TorchMode.Off);
        }
#endif
    }
예제 #3
0
 /// <summary>
 /// Toggles the torch by click the ui button
 /// note: support the feature by using the EasyWebCam Component
 /// </summary>
 public void toggleTorch()
 {
             #if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR
     if (EasyWebCam.isActive)
     {
         if (isTorchOn)
         {
             torchImage.sprite = torchOffSprite;
             EasyWebCam.setTorchMode(TBEasyWebCam.Setting.TorchMode.Off);
         }
         else
         {
             torchImage.sprite = torchOnSprite;
             EasyWebCam.setTorchMode(TBEasyWebCam.Setting.TorchMode.On);
         }
         isTorchOn = !isTorchOn;
     }
             #endif
 }
예제 #4
0
    /// <summary>
    /// Toggles the torch by click the ui button
    /// note: support the feature by using the EasyWebCam Component
    /// </summary>
    public void ToggleTorch()
    {
#if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR
        if (EasyWebCam.isActive)
        {
            if (isTorchOn)
            {
                torchOff.SetActive(true);
                torchOn.SetActive(false);
                EasyWebCam.setTorchMode(TBEasyWebCam.Setting.TorchMode.Off);
            }
            else
            {
                torchOff.SetActive(false);
                torchOn.SetActive(true);
                EasyWebCam.setTorchMode(TBEasyWebCam.Setting.TorchMode.On);
            }
            isTorchOn = !isTorchOn;
        }
#endif
    }