diff --git a/Assets/Scripts/CameraManager.cs b/Assets/Scripts/CameraManager.cs index 32f4568..0504a68 100644 --- a/Assets/Scripts/CameraManager.cs +++ b/Assets/Scripts/CameraManager.cs @@ -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; }