void Start() { //_cameraResolution = VideoCapture.SupportedResolutions.OrderByDescending((res) => res.width * res.height).First(); //_cameraFramerate = VideoCapture.GetSupportedFrameRatesForResolution(_cameraResolution).OrderByDescending((fps) => fps).First(); // full resolution is lagging _cameraResolution = new Resolution() { width = 896, height = 504 }; try { _cameraFramerate = VideoCapture.GetSupportedFrameRatesForResolution(_cameraResolution).OrderByDescending((fps) => fps).First(); } catch (Exception) { _cameraFramerate = 30f; } _mediaPath = Path.Combine(Application.persistentDataPath, MediaPath); var mainCameraGameObject = GameObject.Find("Main Camera"); _cameraBorder = mainCameraGameObject.transform.Find(CameraBorder.name + "(Clone)")?.gameObject; if (_cameraBorder == null) { _cameraBorder = Instantiate(CameraBorder, mainCameraGameObject.transform); } _cameraBorderController = _cameraBorder.GetComponent <CameraBorderController>(); _cameraBorderController.Hide(); }
void OnStoppedVideoCaptureMode(VideoCapture.VideoCaptureResult result) { _takingVideo = false; _videoCapture = null; _cameraBorderController.Hide(); _startRecordingTime = DateTime.MaxValue; OnVideoFinished?.Invoke(_fileName); }
void OnStoppedPhotoMode(PhotoCapture.PhotoCaptureResult result) { // Shutdown the photo capture resource _photoCaptureObject.Dispose(); _photoCaptureObject = null; _takingPicture = false; _cameraBorderController.Hide(); OnPhotoFinished?.Invoke(_fileName); }
void Start() { _cameraResolution = PhotoCapture.SupportedResolutions.OrderByDescending((res) => res.width * res.height).First(); _mediaPath = Path.Combine(Application.persistentDataPath, MediaPath); var mainCameraGameObject = GameObject.Find("Main Camera"); _cameraBorder = mainCameraGameObject.transform.Find(CameraBorder.name + "(Clone)")?.gameObject; if (_cameraBorder == null) { _cameraBorder = Instantiate(CameraBorder, mainCameraGameObject.transform); } _cameraBorderText = _cameraBorder.GetComponentInChildren <TextMeshProUGUI>(); _cameraBorderController = _cameraBorder.GetComponent <CameraBorderController>(); _cameraBorderController.Hide(); }