// Imports image and displays it on the camera-shot object private bool DoImageImport() { Texture2D tex = FaceDetectionUtils.ImportImage(); if (!tex) { return(false); } SetShotImageTexture(tex); return(true); }
// imports image and displays it on the camera-shot object private bool DoImageImport() { Texture2D tex = FaceDetectionUtils.ImportImage(); if (tex && cameraShot) { cameraShot.GetComponent <Renderer>().material.mainTexture = tex; Vector3 localScale = cameraShot.transform.localScale; localScale.x = (float)tex.width / (float)tex.height * Mathf.Sign(localScale.x); cameraShot.transform.localScale = localScale; return(true); } return(false); }