private WebCamTexture web;
public RawImage raw;
IEnumerator RequestCam()
{
yield return Application.RequestUserAuthorization(UserAuthorization.WebCam);
if (Application.HasUserAuthorization(UserAuthorization.WebCam))
{
web = new WebCamTexture();
WebCamDevice[] webD = WebCamTexture.devices;
web.deviceName = webD[0].name;
raw.texture = web;
}
}
public void PlayClick()
{
web.Play();
}
public void StopClick()
{
web.Stop();
}