fix: camera issue when no camera
This commit is contained in:
parent
c0d6aaef98
commit
e43ecb338f
@ -31,11 +31,14 @@ void Start()
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (wTexture)
|
||||
Texture2D texture = GetPhoto();
|
||||
|
||||
if (texture)
|
||||
{
|
||||
photoBox.texture = GetPhoto();
|
||||
Resources.UnloadUnusedAssets();
|
||||
photoBox.texture = texture;
|
||||
}
|
||||
|
||||
Resources.UnloadUnusedAssets();
|
||||
}
|
||||
|
||||
public void WebcamResume()
|
||||
@ -123,7 +126,7 @@ public Texture2D GetPhoto()
|
||||
return photo;
|
||||
}
|
||||
|
||||
if (!wTexture)
|
||||
if (!wTexture || WebCamTexture.devices.Count() < 1)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user