示例#1
0
        private void disconnect()
        {
            if (server != null)
            {
                server.RemoveAllDataProcessors();
                server.Disconnect();
                server = null;
            }

            foreach (var i in cursorToInternalId)
            {
                cancelPointer(i.Value);
            }
            foreach (var i in blobToInternalId)
            {
                cancelPointer(i.Value);
            }
            foreach (var i in objectToInternalId)
            {
                cancelPointer(i.Value);
            }
            cursorToInternalId.Clear();
            blobToInternalId.Clear();
            objectToInternalId.Clear();
        }
示例#2
0
 void disconnect()
 {
     if (tuioServer != null)
     {
         tuioServer.RemoveAllDataProcessors();
         tuioServer.Disconnect();
         tuioServer = null;
     }
 }
示例#3
0
 //停止监听
 private void Disconnect()
 {
     if (mServer != null)
     {
         mServer.RemoveAllDataProcessors();
         mServer.Disconnect();
         mServer = null;
     }
     mMarkerDictionary.Clear();
 }
示例#4
0
 private void OnDisable()//关闭
 {
     if (server != null)
     {
         server.RemoveDataProcessor(cursorProcessor);
         server.RemoveAllDataProcessors();
         server.Disconnect();
         server = null;
     }
 }
示例#5
0
 /// <inheritdoc />
 protected override void OnDestroy()
 {
     if (server != null)
     {
         server.CursorAdded   -= OnCursorAdded;
         server.CursorUpdated -= OnCursorUpdated;
         server.CursorRemoved -= OnCursorRemoved;
         server.Disconnect();
     }
     base.OnDestroy();
 }
示例#6
0
        private void disconnect()
        {
            if (server != null)
            {
                server.RemoveAllDataProcessors();
                server.Disconnect();
                server = null;
            }

            foreach (var i in cursorToInternalId)
            {
                cancelTouch(i.Value.Id);
            }
        }
示例#7
0
 private void Disconnect()
 {
     if (_tuioServer != null)
     {
         _tuioServer.RemoveAllDataProcessors();
         _tuioServer.Disconnect();
         _tuioServer        = null;
         _waitForEndOfFrame = null;
         if (_coroutine != null)
         {
             StopCoroutine(_coroutine);
         }
         _coroutine = null;
         Instance   = null;
     }
 }
示例#8
0
        private static void ListenForTUIO()
        {
            Console.WriteLine(string.Format("TUIO listening on port {0}... (Press escape to quit)", port));

            // tuio
            tuioServer = new TuioServer(port);

            CursorProcessor cursorProcessor = new CursorProcessor();

            cursorProcessor.CursorAdded   += OnCursorAdded;
            cursorProcessor.CursorUpdated += OnCursorUpdated;
            cursorProcessor.CursorRemoved += OnCursorRemoved;

            BlobProcessor blobProcessor = new BlobProcessor();

            blobProcessor.BlobAdded   += OnBlobAdded;
            blobProcessor.BlobUpdated += OnBlobUpdated;
            blobProcessor.BlobRemoved += OnBlobRemoved;

            ObjectProcessor objectProcessor = new ObjectProcessor();

            objectProcessor.ObjectAdded   += OnObjectAdded;
            objectProcessor.ObjectUpdated += OnObjectUpdated;
            objectProcessor.ObjectRemoved += OnObjectRemoved;

            // listen...
            tuioServer.Connect();

            tuioServer.AddDataProcessor(cursorProcessor);
            tuioServer.AddDataProcessor(blobProcessor);
            tuioServer.AddDataProcessor(objectProcessor);

            do
            {
                while (!Console.KeyAvailable)
                {
                    Thread.Sleep(100);
                }
            } while (Console.ReadKey(true).Key != ConsoleKey.Escape);

            // done
            tuioServer.Disconnect();
            tuioServer = null;

            Console.WriteLine("Bye!");
        }
示例#9
0
        /// <inheritdoc />
        protected override void OnDisable()
        {
            if (server != null)
            {
                server.CursorAdded   -= OnCursorAdded;
                server.CursorUpdated -= OnCursorUpdated;
                server.CursorRemoved -= OnCursorRemoved;
                server.Disconnect();
            }

            foreach (var i in cursorToInternalId)
            {
                cancelTouch(i.Value);
            }

            base.OnDisable();
        }