JavaScript => public WebCamTexture()
JavaScript => public WebCamTexture(requestedWidth: int, requestedHeight: int, requestedFPS: int)
JavaScript => public WebCamTexture(requestedWidth: int, requestedHeight: int)
JavaScript => public WebCamTexture(deviceName: string)
JavaScript => public WebCamTexture(deviceName: string, requestedWidth: int, requestedHeight: int)
JavaScript => public WebCamTexture(deviceName: string, requestedWidth: int, requestedHeight: int, requestedFPS: int)
C# => public WebCamTexture();
C# => public WebCamTexture(int requestedWidth, int requestedHeight, int requestedFPS);
C# => public WebCamTexture(int requestedWidth, int requestedHeight);
C# => public WebCamTexture(string deviceName);
C# => public WebCamTexture(string deviceName, int requestedWidth, int requestedHeight);
C# => public WebCamTexture(string deviceName, int requestedWidth, int requestedHeight, int requestedFPS);
Parameters 参数
deviceName
The name of the video input device to be used.
requestedWidth
The requested width of the texture.
requestedHeight
The requested height of the texture.
requestedFPS
The requested frame rate of the texture.
Description 描述
Create a WebCamTexture.
创建一个网络摄像机纹理。
Use WebCamTexture.devices to get a list of the names of available camera devices. If no device name is supplied to the constructor or is passed as a null string, the first device found will be used.
使用WebCamTexture.devices获取相机设备的名称的数组。如果没有设备名称提供给该构造函数或者传递空的字符串,将使用找到的第一个设备名。
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.
选择的相机可能不支持要求的宽,高和指定的帧率。在这种情况下,将会使用最接近的值。
Note: if you want to use WebCamTextures in the web player, you need to get the user's permission to do so. Call Application.RequestUserAuthorization before creating a WebCamTexture.
注意:如果你想在网络播放器中使用WebCamTextures你需要获取使用者的同意。在创建WebCamTexture之前调用 Application.RequestUserAuthorization。
Note: if you want to use WebCamTexture to play the camera stream from device connected through Unity Remote, then you must initalize it through the constructor. Later it's not possible to change device using WebCamTexture.deviceName from regular devices to remote devices and vice versa.
注意:如果你想并通过unity远程连接设备使用WebCamTexture来运行相机流,那么你必须通过构造函数初始化它。然而从常规设备到远程设备使用WebCamTexture.deviceName都不可能改变设备,反之亦然。
本文介绍了Unity中WebCamTexture的使用方法,包括不同参数的构造函数,如设置宽度、高度和帧率。当指定设备名称为空时,将使用默认摄像头。注意,实际参数可能不被所有相机支持,会使用最接近的值。在Web Player中使用需先获取用户授权。此外,初始化WebCamTexture用于Unity Remote时,设备名称必须在构造函数中指定,且不能更改。
1万+

被折叠的 条评论
为什么被折叠?



