コード例 #1
0
ファイル: CameraDevice.cs プロジェクト: in3orn/VirtualSmile
        private void InitCurrentCamera()
        {
            currentIndex  = Mathf.Clamp(config.defaultCamera, 0, cameras.Length);
            currentCamera = cameras[currentIndex];
            currentCamera.texture.Play();

            UpdatePreview();
        }
コード例 #2
0
ファイル: CameraDevice.cs プロジェクト: in3orn/VirtualSmile
        private CameraEntry Create(WebCamDevice device)
        {
            var result = new CameraEntry
            {
                device  = device,
                texture = CreateTexture(device)
            };

            return(result);
        }
コード例 #3
0
ファイル: CameraDevice.cs プロジェクト: in3orn/VirtualSmile
        public void SwitchCamera()
        {
            if (cameras.Length <= 1)
            {
                return;
            }

            if (currentCamera.texture.isPlaying)
            {
                currentCamera.texture.Stop();
            }

            currentIndex++;
            currentIndex %= cameras.Length;

            currentCamera = cameras[currentIndex];
            currentCamera.texture.Play();

            UpdatePreview();
        }