IEnumerator StartCapturing() { yield return(new WaitForSeconds(.1f)); CamCommunicator.StartCapturing(); shouldCapture = true; isCapturing = true; }
void Update() { if (shouldCapture && !isCapturing) { CamCommunicator.StartCapturing(); isCapturing = true; } if (!shouldCapture && isCapturing) { CamCommunicator.EndCapturing(); isCapturing = false; } }