void OnApplicationPause(bool pause) { if (pause) { camera_coroutine_running = false; if (_webcam != null) { _webcam.StopWebcam(); while (!_webcam.Stopped()) { Debug.Log("Waiting camera to stop"); } StopAllCoroutines(); } } else { if (_webcam != null) { camera_coroutine_running = false; StopAllCoroutines(); _webcam.StartWebcam(false); camera_coroutine_running = true; StartCoroutine(CameraLoop()); //StartCoroutine(MarkerUpdateLoop()); } } }
public void LaunchWebcam(WebCamManager webcam) { markerFoundPtr = Marshal.AllocHGlobal(512); viewMatrixData = new HandledArray <float>(Constants.MATRIX_4X4_ARRAY_SIZE); trackedMarkersData = new HandledArray <int>(30); _webcam = webcam; _webcam.StartWebcam(false); StartCoroutine(CameraLoop()); }