private void SetupUIElement() { _controllersParameter = ControllersParametersVariable.Instance; _gazeParameter = GazeParametersVariable.Instance; _interactionContainer = InteractionVariableContainer.Instance; _inputContainer = InputVariableContainer.Instance; _rightIsClicking = _inputContainer.RightClickBoolean.Get("TriggerIsDown"); _leftIsClicking = _inputContainer.LeftClickBoolean.Get("TriggerIsDown"); // If the controllers are not used, we cannot click on the slider, so we will fill the slider with the Over events if (!_controllersParameter.UseControllers && FillWithClick) { FillWithClick = false; Debug.Log("VRSF : UseController is set at false. The auto fill slider won't use the controller to fill but the gaze."); } // We initialize the _EventsDictionary InitializeEventsDictionaries(); // We setup the ListenersDictionary _clickListenersDictionary = _uiSetup.CheckGameEventListenersPresence(_gameEventListenersContainer, _clickListenersDictionary, 6); _overListenersDictionary = _uiSetup.CheckGameEventListenersPresence(_gameEventListenersContainer, _overListenersDictionary, 6); _clickListenersDictionary = _uiSetup.SetGameEventListeners(_clickListenersDictionary, _clickEventsDictionary, _gazeParameter.UseGaze); _overListenersDictionary = _uiSetup.SetGameEventListeners(_overListenersDictionary, _overEventsDictionary, _gazeParameter.UseGaze); }
/// <summary> /// Set the GameEvents and GameEventListeners to null /// </summary> private void InitSOs() { _controllersParameters = ControllersParametersVariable.Instance; _gazeParameters = GazeParametersVariable.Instance; _inputContainer = InputVariableContainer.Instance; _interactionContainer = InteractionVariableContainer.Instance; _geDown = null; _geUp = null; _geTouched = null; _geUntouched = null; _gelDown = null; _gelUp = null; _gelTouched = null; _gelUntouched = null; }
private void SetupUIElement() { _controllersParameter = ControllersParametersVariable.Instance; _gazeParameter = GazeParametersVariable.Instance; _interactionContainer = InteractionVariableContainer.Instance; _inputContainer = InputVariableContainer.Instance; _rightTriggerDown = _inputContainer.RightClickBoolean.Get("TriggerIsDown"); _leftTriggerDown = _inputContainer.LeftClickBoolean.Get("TriggerIsDown"); // If the controllers are not used, we cannot click on a Scroll Bar if (!_controllersParameter.UseControllers) { Debug.Log("VRSF : You won't be able to use the VR ScrollBar if you're not using the Controllers. To change that,\n" + "Go into the Window/VRSF/VR Interaction Parameters and set the UseControllers bool to true."); } // We initialize the _EventsDictionary _EventsDictionary = new Dictionary <string, GameEventTransform> { { "Right", _interactionContainer.RightObjectWasClicked }, { "Left", _interactionContainer.LeftObjectWasClicked }, { "Gaze", _interactionContainer.GazeObjectWasClicked }, }; // We initialize the RaycastHitDictionary _RaycastHitDictionary = new Dictionary <string, RaycastHitVariable> { { "Right", _interactionContainer.RightHit }, { "Left", _interactionContainer.LeftHit }, { "Gaze", _interactionContainer.GazeHit }, }; // We setup the ListenersDictionary _ListenersDictionary = _uiSetup.CheckGameEventListenersPresence(_GameEventListenersContainer, _ListenersDictionary); _ListenersDictionary = _uiSetup.SetGameEventListeners(_ListenersDictionary, _EventsDictionary, _gazeParameter.UseGaze); // Check if the Min and Max object are already created, and set there references _ScrollableSetup.CheckMinMaxGameObjects(handleRect.parent, UnityUIToVRSFUI.ScrollbarDirectionToUIDirection(direction)); _ScrollableSetup.SetMinMaxPos(ref _MinPosBar, ref _MaxPosBar, handleRect.parent); value = 1; }
void Start() { _controllersParameter = ControllersParametersVariable.Instance; _gazeParameter = GazeParametersVariable.Instance; _inputContainer = InputVariableContainer.Instance; _interactionContainer = InteractionVariableContainer.Instance; _leftClick = _inputContainer.LeftClickBoolean.Get("TriggerIsDown"); _rightClick = _inputContainer.RightClickBoolean.Get("TriggerIsDown"); // Set to true to avoid error on the first frame. _interactionContainer.RightHit.isNull = true; _interactionContainer.LeftHit.isNull = true; _interactionContainer.GazeHit.isNull = true; // As we cannot click without controllers, we disable this script if we don't use them if (!_controllersParameter.UseControllers) { this.enabled = false; } }
private void SetupUIElement() { _controllersParameter = ControllersParametersVariable.Instance; _gazeParameter = GazeParametersVariable.Instance; _interactionContainer = InteractionVariableContainer.Instance; _inputContainer = InputVariableContainer.Instance; _rightIsClicking = _inputContainer.RightClickBoolean.Get("TriggerIsDown"); _leftIsClicking = _inputContainer.LeftClickBoolean.Get("TriggerIsDown"); // If the controllers are not used, we cannot click on the slider, so we will fill the slider with the Over events if (!_controllersParameter.UseControllers) { Debug.Log("VRSF : You won't be able to use the VR Handle Slider if you're not using the Controllers. To change that,\n" + "Go into the Window/VRSF/VR Interaction Parameters and set the UseControllers bool to true."); } _EventsDictionary = new Dictionary <string, GameEventTransform> { { "Right", _interactionContainer.RightObjectWasClicked }, { "Left", _interactionContainer.LeftObjectWasClicked }, { "Gaze", _interactionContainer.GazeObjectWasClicked }, }; _RaycastHitDictionary = new Dictionary <string, RaycastHitVariable> { { "Right", _interactionContainer.RightHit }, { "Left", _interactionContainer.LeftHit }, { "Gaze", _interactionContainer.GazeHit }, }; ScrollableSetup.CheckMinMaxGameObjects(handleRect.parent, UnityUIToVRSFUI.SliderDirectionToUIDirection(direction)); _ListenersDictionary = _uiSetup.CheckGameEventListenersPresence(gameEventListenersContainer, _ListenersDictionary); _ListenersDictionary = _uiSetup.SetGameEventListeners(_ListenersDictionary, _EventsDictionary, _gazeParameter.UseGaze); ScrollableSetup.SetMinMaxPos(ref _MinPosBar, ref _MaxPosBar, handleRect.parent); }