コード例 #1
0
        /// <summary>
        /// Raises the destroy event.
        /// </summary>
        void OnDestroy()
        {
            capture.release();

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

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

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

            #if UNITY_WEBGL && !UNITY_EDITOR
            foreach (var coroutine in coroutines)
            {
                StopCoroutine(coroutine);
                ((IDisposable)coroutine).Dispose();
            }
            #endif
        }
コード例 #2
0
        /// <summary>
        /// Raises the destroy event.
        /// </summary>
        void OnDestroy()
        {
            capture.release();

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

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

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

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

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

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

            if (objects != null)
            {
                objects.Dispose();
            }
        }
コード例 #4
0
        public void OnResetTrackerButton()
        {
            if (trackers != null)
            {
                trackers.Dispose();
                trackers = null;
            }
            if (objects != null)
            {
                objects.Dispose();
                objects = null;
            }

            trackers = new MultiTracker("KCF");
            objects  = new MatOfRect2d();
            trackingColorList.Clear();
            selectedPointList.Clear();
        }