Example #1
0
        void shutDown()
        {
            if (pluginThread != null)
            {
                pluginThread.requestStop();
                pluginThread = null;
            }

            //This reference shouldn't be null at this point anyway.
            if (thread != null)
            {
                thread.Join(); //this will cause a slight hiccup in the main calling thread, but without it can occasionally crash...
                thread = null;
            }
            //thread = null; //1 crash noted with this simpler method
        }
Example #2
0
        void OnEnable()
        {
            pluginThread = new depthCamThread(defaultThresholdInMeters);
            setTouchLerp(pluginLerp);

            //	StartCoroutine("StartThread");
            //}

            //private IEnumerator StartThread()
            //{

            //yield return null;

            thread = new Thread(new ThreadStart(pluginThread.runForever));
            thread.Start();
        }