if (CDB.CameraDeviceType == CameraDeviceBaseBehaviour.DeviceType.Back) {
CDB.Close();
Sample.Debug.Log("转前");
CDB.CameraDeviceType = CameraDeviceBaseBehaviour.DeviceType.Front;
//CDB.CameraIndex = 1;
CDB.OpenAndStart();
} else {
CDB.Close();
CDB.CameraDeviceType = CameraDeviceBaseBehaviour.DeviceType.Back;
//CDB.CameraIndex = 2;
CDB.OpenAndStart();
Sample.Debug.Log("转后");
}
cdb是CameraDeviceBaseBehaviour的实例
sample.debug是因为我加了一层的简单调试器。
网友评论