VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
void AVR.UI.Utils.AVRUI_ClickDragWheel.Update ( )
inlineprivate

Definition at line 69 of file AVRUI_ClickDragWheel.cs.

69  {
70  Vector2 selec = radius * VRInput.Instance.inputManager.getEventStatus(selectionAxis);
71 
72  lr.SetPositions(new Vector3[] {Vector3.zero, new Vector3(selec.x, selec.y)});
73 
74  float angle = Vector2.SignedAngle(selec, Vector2.up)+180.0f;
75 
76  selectedEntry = null;
77  foreach(ClickDragWheelEntry entry in fields) {
78  if(selec.magnitude > select_radius && angle>entry.min_angle && angle<entry.max_angle) {
79  entry.prefabObject.markSelected(true);
80  selectedEntry = entry;
81  }
82  else {
83  entry.prefabObject.markSelected(false);
84  }
85  }
86 
87  if (selectedEntry!=null && VRInput.Instance.inputManager.getEventStatus(selectionEvent))
88  {
89  selectedEntry.OnSelectEvent.Invoke();
90  Cancel();
91  }
92  else if(VRInput.Instance.inputManager.getEventStatus(AVR_ControllerInputManager.BoolEvent.ANY_CANCEL)) {
93  Cancel();
94  }
95  }
BoolEvent
Boolean-returning events of a controller.
Manages inputs of a controller such as button presses and track-pad inputs.
AVR_ControllerInputManager.BoolEvent selectionEvent
AVR_ControllerInputManager.Vec2Event selectionAxis