public override void PrepareView(ViewPanelsController viewPanelsController)
        {
            base.PrepareView(viewPanelsController);
            cameraTexture.texture = rawImageSettings.DefaultTexture;

            viewPanelsController.OnViewChange += HandleOnViewChange;
            _rawImageRectTransform             = cameraTexture.rectTransform;

            WebCamDevice[] devices = WebCamTexture.devices;

            if (devices.Length > 0)
            {
                foreach (var device in devices)
                {
                    if (device.isFrontFacing)
                    {
                        _photoCameraTexture = new WebCamTexture(device.name, Screen.width, Screen.height, 60)
                        {
                            filterMode = FilterMode.Trilinear
                        };
                    }
                }
            }

            _camIsAvailable = _photoCameraTexture != null;

            if (_camIsAvailable)
            {
                StartRecording();
            }
        }
Esempio n. 2
0
        public void PrepareButton(ViewPanelsController viewPanelsController)
        {
            _image = GetComponent <Image>();
            _viewPanelsController = viewPanelsController;
            _viewPanelsController.OnViewChange += HandleOnViewChange;

            HandleOnViewChange(viewPanelsController.CurrentView);
        }
        public void TakePicture()
        {
            Texture2D picture = new Texture2D(_photoCameraTexture.width, _photoCameraTexture.height);

            picture.SetPixels(_photoCameraTexture.GetPixels());
            picture.Apply();

            string path = FileHelper.SaveImageHelper(picture);

            ViewPanelsController.ShowDetailView(path, picture);
        }
Esempio n. 4
0
 public virtual void PrepareView(ViewPanelsController viewPanelsController)
 {
     ViewPanelsController = viewPanelsController;
     Position             = GetComponent <RectTransform>().anchoredPosition;
     navigationButton.PrepareButton(viewPanelsController);
 }
Esempio n. 5
0
 public override void PrepareView(ViewPanelsController viewPanelsController)
 {
     base.PrepareView(viewPanelsController);
     LoadGallery();
 }