Exemple #1
0
        /// <inheritdoc />
        protected override void Start()
        {
            base.Start();

            server = new TuioServer(TuioPort);
            server.MovementThreshold = MovementThreshold*TouchManager.Instance.DotsPerCentimeter/Mathf.Max(Screen.width, Screen.height);
            server.CursorAdded += OnCursorAdded;
            server.CursorUpdated += OnCursorUpdated;
            server.CursorRemoved += OnCursorRemoved;
            server.Connect();
        }
Exemple #2
0
        /// <inheritdoc />
        protected override void OnEnable()
        {
            base.OnEnable();

            server = new TuioServer(TuioPort);
            server.MovementThreshold = MovementThreshold * manager.DotsPerCentimeter/Mathf.Max(Screen.width, Screen.height);
            server.CursorAdded += OnCursorAdded;
            server.CursorUpdated += OnCursorUpdated;
            server.CursorRemoved += OnCursorRemoved;
            server.Connect();
        }
Exemple #3
0
        private void disconnect()
        {
            if (server != null)
            {
                server.RemoveAllDataProcessors();
                server.Disconnect();
                server = null;
            }

            foreach (var i in cursorToInternalId)
            {
                cancelTouch(i.Value.Id);
            }
        }
Exemple #4
0
        private void connect()
        {
            if (!Application.isPlaying) return;
            if (server != null) disconnect();

            server = new TuioServer(TuioPort);
            server.Connect();
            updateInputs();
        }