/// <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(); }
/// <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(); }
private void disconnect() { if (server != null) { server.RemoveAllDataProcessors(); server.Disconnect(); server = null; } foreach (var i in cursorToInternalId) { cancelTouch(i.Value.Id); } }
private void connect() { if (!Application.isPlaying) return; if (server != null) disconnect(); server = new TuioServer(TuioPort); server.Connect(); updateInputs(); }