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); } } }
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); }
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); }
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 = ""; } }
public static void TakePhoto() { NatCam.CapturePhoto(OnPhoto); }