Compare commits

..

No commits in common. "a6e67d3b76ba17a42e685d4b6a6b70f3ca746c43" and "878a8d18fa3fa91e659141ad699e5a2622467766" have entirely different histories.

View File

@ -4,17 +4,18 @@
public class CameraManager : MonoBehaviour public class CameraManager : MonoBehaviour
{ {
public WebCamTexture wTexture;
public WebCamDevice wDevice; public WebCamDevice wDevice;
public Button freezeButton; public Button freezeButton;
public Button resumeButton; public Button resumeButton;
public RawImage photoBox; public RawImage photoBox;
private Texture2D photo; private Texture2D photo;
private int numberOfWebcams; private int numberOfWebcams;
private WebCamTexture wTexture;
// Start is called before the first frame update // Start is called before the first frame update
void OnEnable() void OnEnable()
{ {
wTexture = new WebCamTexture(wDevice.name);
WebcamResume(); WebcamResume();
} }
@ -44,9 +45,6 @@ void Update()
public void WebcamResume() public void WebcamResume()
{ {
if (wTexture == null)
wTexture = new WebCamTexture(wDevice.name);
wTexture.Play(); wTexture.Play();
photo = null; photo = null;
freezeButton.gameObject.SetActive(true); freezeButton.gameObject.SetActive(true);