private void InitCurrentCamera() { currentIndex = Mathf.Clamp(config.defaultCamera, 0, cameras.Length); currentCamera = cameras[currentIndex]; currentCamera.texture.Play(); UpdatePreview(); }
private CameraEntry Create(WebCamDevice device) { var result = new CameraEntry { device = device, texture = CreateTexture(device) }; return(result); }
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(); }