Example #1
0
        protected void OnCaptureError(CaptureErrorEventArgs args)
        {
            EventHandler <CaptureErrorEventArgs> handler = OnError;

            if (handler != null)
            {
                handler(this, args);
            }
        }
Example #2
0
        /// <summary>
        /// Update is called every frame, if the MonoBehaviour is enabled.
        /// </summary>
        protected void Update()
        {
            if (startOnAwake)
            {
                if (Time.time >= captureTime && status == CaptureStatus.STARTED)
                {
                    StopCapture();
                }
                if (quitAfterCapture && status == CaptureStatus.READY)
                {
#if UNITY_EDITOR
                    UnityEditor.EditorApplication.isPlaying = false;
#else
                    Application.Quit();
#endif
                }
            }

            while (completeEventQueue.Count > 0)
            {
                CaptureCompleteEventArgs args = completeEventQueue.Dequeue();
                OnCaptureComplete(args);
            }

            while (errorEventQueue.Count > 0)
            {
                CaptureErrorEventArgs args = errorEventQueue.Dequeue();
                OnCaptureError(args);
            }

            if (!string.IsNullOrEmpty(lastVideoFile))
            {
                // Save last recorded video file
                VideoCache.CacheLastVideoFile(lastVideoFile);
                lastVideoFile = "";
            }
        }
Example #3
0
 private void HandleCaptureError(object sender, CaptureErrorEventArgs args)
 {
     //UnityEngine.Debug.Log(args.ErrorCode);
 }
Example #4
0
 protected void EnqueueErrorEvent(CaptureErrorEventArgs evtArgs)
 {
     errorEventQueue.Enqueue(evtArgs);
 }