/// <inheritdoc/> public override void OnPointerHover(RaycastResult raycastResult, bool isInteractive) { pointer_dot.transform.position = raycastResult.worldPosition; if (SerialCommunication.buttonState) { GameObject trailPoint = new GameObject(); trailPoint.transform.position = raycastResult.worldPosition + new Vector3(0, 0, -50); trRander.AddPoint(trailPoint); } }
/// <inheritdoc/> public override void OnPointerHover(RaycastResult raycastResult, bool isInteractive) { SetPointerTarget(raycastResult.worldPosition, isInteractive); LastPointerHoveredResult = raycastResult; AddRaycastPoint(Time.time, raycastResult); if ((!raycastResult.gameObject.tag.Equals("Key") && !raycastResult.gameObject.tag.Equals("Prediction")) || !isGestureValid) { return; } if (Triggering) { GameObject trailPoint = new GameObject(); trailPoint.transform.position = raycastResult.worldPosition + trRander.Drawing_Surface; trailPoint.transform.SetParent(canvas.transform); trRander.AddPoint(trailPoint); float x = trLocal.InverseTransformPoint(trailPoint.transform.position).x; float y = trLocal.InverseTransformPoint(trailPoint.transform.position).y; x = (float)(x * server.coef_x + server.keyboard_x / 2.0); y = (float)(-y * server.coef_y + server.screen_y - (server.keyboard_y / 2.0)); //UnityEngine.Debug.Log("SEND X:" + x + " Y:" + y); if (trRander.trailPoints.Count == 1 && server.IsConnected && isGestureValid && !isInputEnd) { server.SendToClient($"d;{(int)(x)};{(int)(y)};\r\n"); if (entryProcessing.LastTagDown.Equals("Key")) { measuringMetrics.StartGesture(); } } else if (++hoverCounter % 1 == 0 && server.IsConnected && isGestureValid && !isInputEnd) { server.SendToClient($"{(int)(x)};{(int)(y)};\r\n"); } } }