0 votes
by (120 points)

使用脚本挂到一个RawImage上,在Unity的预览界面上运行可以正常显示画面,但在一体机上只能显示黑屏,尝试切换usb摄像头的通路也不行。
脚本代码:
using System.Collections;
using UnityEngine;
using UnityEngine.UI;

public class Extracamera : MonoBehaviour
{
public int a = 0;
RawImage cameraImage;
private WebCamTexture webCamTex;
IEnumerator Start()
{
cameraImage = GetComponent();
yield return Application.RequestUserAuthorization(UserAuthorization.WebCam);
if (Application.HasUserAuthorization(UserAuthorization.WebCam))
{
WebCamDevice[] devices = WebCamTexture.devices;
if (devices != null)
{
webCamTex = new WebCamTexture(devices[a].name, 800, 1280, 120);
webCamTex.Play();
cameraImage.texture = webCamTex;
}
}
}
}

1 Answer

0 votes
by (37.0k points)

开发者你好,
Pico一体机设备目前不支持外接摄像头的功能

by (120 points)

好的非常感谢您的解答

...