如何通过 Unity 和 C# 获取相机详细信息?

How can I get camera details through Unity and C#?

我正在尝试在 Unity - Windows 中使用 WebCamTexture 属性,我在撰写本文时使用的是 Unity 5.2 版。我可以使用 WebCamTexture.height 和 WebCamTexture.requestedHeight.

但是我如何知道用户的相机有什么功能?如果用户的相机不支持高清,而我想获得 1280x720 的图片怎么办?我很想听听您对此的意见。

设置您想要的分辨率。如果硬件不支持,它将使用最接近的支持值。

The requested width, height and framerate specified by the parameters may not be supported by the chosen camera. In such cases, the closest available values will be used.

http://docs.unity3d.com/ScriptReference/WebCamTexture-ctor.html