コード例 #1
0
        /// <summary>
        /// Raises the destroy event.
        /// </summary>
        void OnDestroy()
        {
            if (webCamTextureToMatHelper != null)
            {
                webCamTextureToMatHelper.Dispose();
            }

            if (faceLandmarkDetector != null)
            {
                faceLandmarkDetector.Dispose();
            }

            if (lowPassFilter != null)
            {
                lowPassFilter.Dispose();
            }
            if (kalmanFilter != null)
            {
                kalmanFilter.Dispose();
            }
            if (opticalFlowFilter != null)
            {
                opticalFlowFilter.Dispose();
            }

            #if UNITY_WEBGL && !UNITY_EDITOR
            foreach (var coroutine in coroutines)
            {
                StopCoroutine(coroutine);
                ((IDisposable)coroutine).Dispose();
            }
            #endif
        }
        /// <summary>
        /// Raises the destroy event.
        /// </summary>
        void OnDestroy()
        {
            if (sourceToMatHelper != null)
            {
                sourceToMatHelper.Dispose();
            }

            if (faceLandmarkDetector != null)
            {
                faceLandmarkDetector.Dispose();
            }

            if (lowPassFilter != null)
            {
                lowPassFilter.Dispose();
            }
            if (kalmanFilter != null)
            {
                kalmanFilter.Dispose();
            }
            if (opticalFlowFilter != null)
            {
                opticalFlowFilter.Dispose();
            }

#if UNITY_WEBGL
            if (getFilePath_Coroutine != null)
            {
                StopCoroutine(getFilePath_Coroutine);
                ((IDisposable)getFilePath_Coroutine).Dispose();
            }
#endif
        }
コード例 #3
0
        /// <summary>
        /// Raises the destroy event.
        /// </summary>
        void OnDestroy()
        {
            if (capture != null)
            {
                capture.release();
            }

            if (rgbMat != null)
            {
                rgbMat.Dispose();
            }

            if (texture != null)
            {
                Texture2D.Destroy(texture);
                texture = null;
            }

            if (faceLandmarkDetector != null)
            {
                faceLandmarkDetector.Dispose();
            }

            if (lowPassFilter != null)
            {
                lowPassFilter.Dispose();
            }
            if (kalmanFilter != null)
            {
                kalmanFilter.Dispose();
            }
            if (opticalFlowFilter != null)
            {
                opticalFlowFilter.Dispose();
            }

            #if UNITY_WEBGL && !UNITY_EDITOR
            if (getFilePath_Coroutine != null)
            {
                StopCoroutine(getFilePath_Coroutine);
                ((IDisposable)getFilePath_Coroutine).Dispose();
            }
            #endif
        }