11 [Tooltip(
"In degrees")]
public float AngleOfAcceptance = 45.0f;
15 public float TextDisplayTime = 5.0f;
19 private Coroutine displayForSecondsCoroutine;
24 float smallestAngle =
float.PositiveInfinity;
29 Vector3 camToGroup = group.transform.position - cameraTransform.position;
30 float gazeObjectAngle = Vector3.Angle(camToGroup, cameraTransform.forward);
31 if (group.
Targets.Length > 0 && gazeObjectAngle < AngleOfAcceptance && gazeObjectAngle < smallestAngle)
33 smallestAngle = gazeObjectAngle;
42 if (newGroup == currentGroup)
46 currentGroup = newGroup;
53 private void UpdateText()
58 DisplayText.text +=
"\r\nvelocity";
61 if (displayForSecondsCoroutine != null)
63 StopCoroutine(displayForSecondsCoroutine);
65 displayForSecondsCoroutine = StartCoroutine(DisplayForSeconds(TextDisplayTime));
68 private IEnumerator DisplayForSeconds(
float displayTime)
70 yield
return new WaitForSeconds(displayTime);
71 DisplayText.text =
"";