示例#1
0
    public override void Photograph(Action <Texture2D> onImageAction)
    {
        try
        {
            NatCam.Camera.SetPhotoResolution(512, 512);

            NatCam.CapturePhoto((image, orientation) =>
            {
                onImageAction(OrientatePhoto(image, Input.deviceOrientation));
            });
        }
        catch (Exception e)
        {
            Debug.Log("Failed to take photo, trying a low res version");
            Debug.Log(e.Message);

            try
            {
                NatCam.Camera.SetPhotoResolution(ResolutionPreset.LowestResolution);

                NatCam.CapturePhoto((image, orientation) =>
                {
                    onImageAction(OrientatePhoto(image, Input.deviceOrientation));
                });
            }
            catch (Exception lowResAttemptException)
            {
                Debug.Log("Failed to take photo");
                Debug.Log(lowResAttemptException.Message);
            }
        }
    }
示例#2
0
        public virtual void CapturePhoto()
        {
            // Divert control if we are checking the captured photo
            //if (!checkIco.gameObject.activeInHierarchy) NatCam.CapturePhoto(OnPhoto);
            // Check captured photo
            //else OnViewPhoto();

            Debug.Log("CapturePhoto() called, NatCam.Camera.PreviewResolution = " + NatCam.Camera.PreviewResolution);
            NatCam.CapturePhoto(OnPhoto);
        }
示例#3
0
 public void CapturePhoto()
 {
     //Divert control if we are checking the captured photo
     if (checkIco.gameObject.activeInHierarchy)
     {
         OnCheckedPhoto();
         //Terminate this control chain
         return;
     }
     //Capture photo with our callback
     NatCam.CapturePhoto(OnCapturedPhoto);
 }
示例#4
0
 public virtual void CapturePhoto()
 {
     // Divert control if we are checking the captured photo
     if (!checkIco.gameObject.activeInHierarchy)
     {
         NatCam.CapturePhoto(OnPhoto);
     }
     // Check captured photo
     else
     {
         OnView();
     }
 }
 // Update is called once per frame
 void Update()
 {
     if (conteo)
     {
         timerFoto      -= Time.deltaTime;
         timerTexto.text = Mathf.RoundToInt(timerFoto).ToString();
         if (timerFoto <= 0)
         {
             NatCam.CapturePhoto(OnPhoto);
             pC.BotonTomarFoto();
             timerFoto = 3;
             conteo    = false;
         }
     }
     else
     {
         timerTexto.text = "";
     }
 }
示例#6
0
 public static void TakePhoto()
 {
     NatCam.CapturePhoto(OnPhoto);
 }